12 Replies Latest reply: Sep 13, 2015 5:05 AM by Enrique Colomer

# 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

• ###### Re: Variables in Set analysis

Can you post a qlikview document that demonstrates the problem?

• ###### Re: Variables in Set analysis

There is a parenthesis missing after your variable.

• ###### Re: Variables in Set analysis

See this examples:

• ###### Re: Variables in Set analysis

Good info Enrique Colomer

Thanks for sharing.

• ###### Re: Variables in Set analysis

Dear Enrique Colomer,

Please explain, how did you created so many charts inside one box !

And also how did you created the different box tabs  " Distribution Annual" "Penetration Por" "........" using the same Table!!

Many Thanks,

• ###### Re: Variables in Set analysis

OK,

I used a CONTAINER in order to group some objects in the same place.

And, in some graphics are TRELLIS

• ###### Re: Variables in Set analysis

Hi Simon,

Try this....

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

Regards,

Rakesh

• ###### Re: Variables in Set analysis

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.

Jagan.

• ###### Re: Variables in Set analysis

Set Analysis Wizard for QlikView | qlikblog.at

Set Analysis Wizard for QlikView | qlikblog.at

• ###### Re: Variables in Set analysis

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.

• ###### Re: Variables in Set analysis

Hi Simon,

Please try to write your variable without '=' and insert it in Double Quotation.

Also added '=' in you variable definition.

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