Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Why is Qlikview not evaluating my variable in a chart correctly

I have some functions that I'm using more than once in chart/table creation in qlikview:

I have a few concerns. Whenever I try to store my function:

=(SUM({<[Not_my_Dummy] = {'1'}, some_dummy= {'1'}>} [0-7_dummy]) + SUM([ACDV_0-7_dummy]))/(COUNT({<[Not_my_Dummy] = {'1'}, some_dummy= {'1'}>} [0-7_dummy]) + COUNT([ACDV_0-7_dummy]))

into a variable it causes some issues...

First, this is how my chart looks with my Dimension set to Month:

Var_before.png

BUT, if I click on ANY of these given months, the value suddenly changes to what "may or may not be" the correct number:

Var_after.png

Why is Qlikview doing this? surely people can't be reusing functions over and over in each chart/table they create, only to change them all one-by-one if needed....

Also, I have the SAME function stored in a chart/table with the SAME dimension, and qlikview returns different numbers.... has anyone else had an issue with this?

1 Solution

Accepted Solutions
Highlighted
Master II
Master II

Do not use = when storing the expression into variable.

(SUM({<[Not_my_Dummy] = {'1'}, some_dummy= {'1'}>} [0-7_dummy]) + SUM([ACDV_0-7_dummy]))/(COUNT({<[Not_my_Dummy] = {'1'}, some_dummy= {'1'}>} [0-7_dummy]) + COUNT([ACDV_0-7_dummy]))

View solution in original post

4 Replies
Highlighted

How did you define your variable?

Highlighted
Master II
Master II

Do not use = when storing the expression into variable.

(SUM({<[Not_my_Dummy] = {'1'}, some_dummy= {'1'}>} [0-7_dummy]) + SUM([ACDV_0-7_dummy]))/(COUNT({<[Not_my_Dummy] = {'1'}, some_dummy= {'1'}>} [0-7_dummy]) + COUNT([ACDV_0-7_dummy]))

View solution in original post

Highlighted
MVP & Luminary
MVP & Luminary

I suspect that your variable definition begins with the equal sign, right? If that's the case, it means that your expression is being calculated once, not in the context of your chart dimensions. For that reason, you are getting identical values across the chart. For the same reason, the result looks better if you make a selection - after your selection, the formula in the variable gets evaluated again, and it shows a "better" result now.

Long story short - remove the equal sign in front of your formula in the variable definition and see what happens.

cheers,

Oleg Troyansky

Learn advanced QlikView and Qlik Sense techniques in my book QlikView Your Business

Oleg Troyansky

Masters Summit for Qlik is going virtual! Dec 16th - I'll teach Performance Tuning

Highlighted
Champion II
Champion II