Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis to calculate inter records

suppose I have the following table:

TicketID, Sales

TicketID is running from 1 to 1000 and assuming it's sorted ascending.

I want to compare the sales of any ticket to the sales of the following X tickets.for Example:

If the sales of the current ticket is larger than the sales of obe of the following 5 tickets, then 1, otherwise, 0.

Can I please post an example with set analysis of how it can be done?

5 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

This problem cannot be solved with Set Analysis, becasue Set Analysis cannot be sensitive to individual chart cells. I'd look into functions above() and below() to solve your issue.

Not applicable
Author

The problem is that above and below can be directed to a specific record. Here, I need to summaraize several X records. any ideas?

danielrozental
Master II
Master II

you can combine above with rangesum, rangeavg, etc.

Not applicable
Author

This is a good idea and I indeed found and example in QlikView "Help". However, when I try to use it, exactly as the example shows, it doesn't give me the expected results. It doesn't go over the range of records but only on the first record. I opened a bug at Support but do you know if it's working? do you have a working example?

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

above() and below() have two optional parameters for "offset" and "number of instances". You can ask for any desired number of instances above or below.