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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis with variable

Hello everybody,

I have a silly problem about Set Analysis that I wasn't able to solve reading all the manuals and examples I found on internet.

I need to compare a field to a variable inside the modifier.

I have Pax associated to some IDs. I want the Sum of Pax for only a specific ID, contained in the variable vID1 (it is the latest ID obtained with the function rank, but I tested and it works)

Sum ({$<ID={"$(vID1)"}>} Pax)

Probably I am doing a mistake in the sintax, but I can't understand where!

Thanks!

Matt

25 Replies
Not applicable
Author

Hi Mohammed,

the reason is that I need to compare the last ID with the previous one (or the previous 2 or 3).

Since the ID are not consequent (there are some missing, eg: 1, 3, 8, 9, 10, 15. No pattern at all) the rank function is the only solution I found to my problem.

The variable seems to work in the straight table, or in the textbox, but not in the formula.

Thanks
Matt

jagan
Partner - Champion III
Partner - Champion III

Hi,

Use this as Rank formula

vIdMax  :::::::: Rank(Sum(PAX))

Dimension :: ID

Expression :: =$(vIdMax)

If you are not expecting this, come up with an example.

Regards,

Jagan.

jagan
Partner - Champion III
Partner - Champion III

Hi,

If you want to compare previous row in chart try Above(), refer Qlikview help file for detailed help.

Regards,

Jagan.

Not applicable
Author

Hi Jagan,

thanks for the reply.

I need to rank according to the ID (the higher, the most recent), not to rank according to pax. I sent a qlikview few post above, I'm still stuck at that point

Thanks

Matt

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this expression

=Rank(-ID)

Regards,

Jagan.

Not applicable
Author

Hi Jagan,

I used the expression Rank (ID).

With the minus it only changes the order, but the problem remains.

Thanks

Matt