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
ashfaq_haseeb
Champion III
Champion III

Hi,

Try like this

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

or

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


Regards

ASHFAQ

Not applicable
Author

Hi,

May be Try like below:

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

Best,

Robert

Not applicable
Author

All 3 formulas gave me 0 as result.

If i write the formula without the Variable but with the # of the ID i get the sum of pax.

If i test the variable with (vID)  i get the right id.

If I put them together it doesn't work.

Thanks

Matt

ashfaq_haseeb
Champion III
Champion III

Hi,

Sample application attached for you.

Set analysis is case sensitive make sure you have same field name.

If possible post your application to help you with.

Regards

ASHFAQ

simondachstr
Specialist III
Specialist III

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

maxgro
MVP
MVP

to debug set analysis

add a chart with only your expression, remove label as in image

and let we know the output

1.png

Not applicable
Author

Hi Mohammed,

I added a variable that rank the ID (like in my original case). Doing that your set analysis doesn't work anymore.

And it's the exact same case that I am facing, and I am not able to see what I am missing.

Thanks

Matt

ashfaq_haseeb
Champion III
Champion III

Hi,

Without seeing code its hard to analyze.

did you follow Massimo Grossi suggestion.

If possible post sample Application to look over.

Regards

ASHFAQ

Not applicable
Author

I added the chart as you told to the example I sent back to Mohammed, that's the output:

Qlikview.png

I don't get any error in the expression, but the sum it's just 0