Hi all - I'm trying to filter a summary search to ...
# suiteanalytics
g
Hi all - I'm trying to filter a summary search to only lines with the largest Line ID in each transaction. I was able use the following formula in the Result and in Highlighting to see which rows I want to filter to, but encounter an error whenever I try to add it to the Criteria. Can anyone see what I'm doing wrong or have another approach that would work?
Copy code
CASE WHEN {line} = MAX/* comment */({line}) OVER (PARTITION BY {internalid}) THEN 1 ELSE 0 END
šŸ˜… 1
It is not currently a Summary Search, but I thought it'd be important to mention in case the timing of when Analytic Functions are executed was an key factor. The screenshot is what I have so far - what I want is to filter to only the green rows; then I'll remove my formula from the results and apply summary types to the other columns
n
Have you tried using Order By column on the results?
That is intended to allow you to show a column result which matches the highest (or lowest) of another column
g
Thanks for the suggestion. I did try that, and it ultimately didn’t work for my use case. I’m working with inventory cost evaluations which seem to be an odd record type. The cost components, sublist all share the same value for line ID and so it acts more like a revision; when new inventory cost revaluations are generated for an item at a location on a given date, all of the line IDs are incremented by one. My goal is to filter my results to the latest ā€œrevisionā€.
Once I have the value from the latest revisions, I need to sum those values
n
Is there a Last Date Modified?
g
I believe so, but all lines are returned including previous revisions
In other words, I may open the record and have four lines in my cost components but when I load the search results, there’s the same for cost components with line ID one and again with line ID two
n
Can you try is Date Last Modified as a column set to Max. Then use Ordered By as Date Last Modified
g
I don’t think I can use the ordered by column because I need to Sum my ā€œMax when ordered by line IDā€
that’s what sent me down this road of using the analytic version of Max
šŸ˜ž 1
āœ”ļø 1
m
I don’t think you can use these aggregate functions in criteria. There’s a support article about DENSE_RANK and RANK. They are not allowed in criteria of summary searches
g
That was my suspicion as well, analytic functions are one of the last to be executed. Adding ideas on how to only sum values with the largest line ID's in a summary search?
m
You could add a custom column checkbox called ā€œlast lineā€. Then use a script to check that box on all your transactions for the largest line ID. The make a saved search where ā€œlast lineā€ = T and then you can summarize that Or You would have to make a search of all the largest line IDs then sum in excel Or use a connected BI tool. But either way it would be offline
g