Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help using the "above" function in a pivot object.

I am trying to return a value based on a previous record in a pivot, but the "above: function does not seem to be working for me. Attached is a picture of what I am trying to do. Any ideas? Thanks! - Mikeerror loading image

10 Replies
Not applicable
Author

Thanks for the tip. I finally got this resolved by creating a resident table using the previous function:

INNER JOIN
LOAD
CPvCCC AS CPvCCCx,
Daily_Production_Schedule.Production_Run_ID,
if(CPvCCC=previous(CPvCCC), '0', '1') as CPvCCCChange
RESIDENT DailyProduction;

I used the previous function to create a value of 1 if the change accorded. Then I inner joined back to the main table on Production Run ID, and just simply summed up all the "1"s to be found. The comparison of records within dimension groups was confusing, but once I understand that, I was able to come up with the resident table work around using the "previous" function. The key was to limit my data set down to two columns... Thanks for the help.