Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variables in Set analysis

Good afternoon community,

I still find it difficult to get variables within set analysis to work.

I am trying to get sum of sales for prior year, and have set up the variable as such.

The outcome of the variable is: "15 | 2014"

I then insert the variable into the below formula, but can't get the syntax right

=NUM(SUM({1<%Date_Period={'=$(vPriorYear'}>}Sessions),'###,###.')

The below formula works ok, and gives a result:

=NUM(SUM({1<%Date_Period={'15 | 2014'}>}Sessions),'###,###.')

Any help will be greatly appreciated, I've gone round in so many circles!!

Thanks,

Simon

Hi all, I've tried what you suggested, but still stuck - I'm not sure if it is the way that I have written the variable, but I can't pinpoint why it won't work for me. Thank you for your advice so far, Simon

12 Replies
Gysbert_Wassenaar

Can you post a qlikview document that demonstrates the problem?


talk is cheap, supply exceeds demand
marcus_sommer

‌There is a parenthesis missing after your variable.

ecolomer
Master II
Master II

See this examples:

Not applicable
Author

Hi Simon,

Try this....

=sum({<Date_Period={'$(vPriorYear)'}>}Sessions)

Regards,

Rakesh

qlikviewwizard
Master II
Master II

Good info ecolomer

Thanks for sharing.

jagan
Luminary Alumni
Luminary Alumni

Hi Simon,

You missed the ) after vPriorYear, that is why it is not working, try below expression

=NUM(SUM({1<[%Date_Period]={'=$(vPriorYear)'}>} Sessions),'###,###')


Hope this helps you.


Regadrs,

Jagan.

sasiparupudi1
Master III
Master III

Please post your application

svenkita
Creator II
Creator II

This site could be helpful for you. it help you to build the set analysis

Set Analysis Wizard for QlikView | qlikblog.at

Set Analysis Wizard for QlikView | qlikblog.at

qlikviewwizard
Master II
Master II

Hi simonriwatson

Can you post the application to demonstrate the issue. This will help the folks to give best solution in quickly. Otherwise answers will be given based on guessing. Thank you.