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

Announcements
Join us in Bucharest on Sept 18th 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,

Can you expand this image fully.

I need to see complete code.

Regards

ASHFAQ

Not applicable
Author

I meant to send you back the file but I forgot to attach it 

And now I am trying to figure out how to attach it

Not applicable
Author

Qlikview.png

ashfaq_haseeb
Champion III
Champion III

See,

Your variable is not returning anything you need to fix that.

As it returns null, therefore you get zero.

Regards

ASHFAQ

jagan
Partner - Champion III
Partner - Champion III

Hi,

Check your variable in Text object by giving

=vID1

Currently your variable is giving null value, that is why you are getting 0.  Fix the variable definition, automatically the set analysis expression works.

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Hi Mohammed,

the problem is that the variable works outside the set analysis (see attached).

But it doesn't work when embedded in set analysis.

Thanks!

Matteo

Not applicable
Author

Hi jagan, 

I attached the file, I checked the variable in a textbox and the result is correct.

That's why I can't explain what's wrong with the set analysis, since the variable works by itself.

Thanks!

Matt

jagan
Partner - Champion III
Partner - Champion III

Hi,

What is your expected output?  Can you come up with an example.  You are using vID1 or vIDMax in expression?

Regards,

Jagan.

ashfaq_haseeb
Champion III
Champion III

Hi,

You need to fix your variable.

Variable is not working outside even

instead of Rank(ID) try with Max(ID) as your variable definition.

Can you come up with proper explanation for what purpose you need rank here.

Regards

ASHFAQ

Not applicable
Author

I need to use vIDMax (the one with rank formula)

Thanks

Matt