Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am working on a table where I need to be able to compare the value for a record ID from the current row to the record ID from the prior row. I have researched somewhat, but have not been able to determine how to accomplish this. A simple example is:
Row 1 - Record ID is '1A4B8C'
Row 2 - Record ID is '1A4B16C'
Row 3 - Record ID is '1A4B16C'
So the first test comparing Row 2 back to Row 1 would need to show False, while the second test comparing Row 3 to Row 2 would show True. I am working with A/N fields and need to work on the table sort order.
I have looked at ABOVE() but it appears to be for counts rather than a straight match.
Any help is appreciated. Thanks, Mitch
Are you working this on script level or on front end?
This can be done on the script level. What you need to use is the function Previous().
You can create a logic in the script, if(Previous(ID)=ID, 'True', 'False'). Since you are comparing from bottom to top, you need to order by the table in descending.
Unfortunately, I am working on the front end and do not have access to the script, so the solution needs to be one that can be used in an expression. Thanks for the suggestion!
can you try if this works:
if(below(total ID)=ID, 'True','False')
Thanks. I tried both using Above and Below. The "Total" qualifier seems to make the difference. However, it will only work as a Measure; when I try as a Dimension, I get an "Invalid Dimension" error. Ideally, I would like to suppress the row using this condition when false. This is a great lead, let me take it an run with it a bit. 🙂
that is quite a challenge. if you want it as a dimension, best to create it in script level.
Thanks for the information. I may just have to live with it as is and accept the redundancy on the report. I will be able to use this in the graphical (numeric) visualizations, so thanks again!