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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variables with Different results

HI,

I'm learning about variables and I am having some difficulties.

For Example:

I have a variable that is set up in my app called vGlobal_Ranking

If I use this variable in a KPI or a Gage  I get Result 'X' (Which is the correct answer)

If I use this exact same variable in a table in the visualization, I get a completely different result (wrong result)

All 3 have the exact same measure, $(vGlobal_Ranking).

Why am I getting a different result in the table vs KPI or Gage? 

The variables were causing errors in my reports and had to be eliminated completely, leading to very complicated formulas.

I think i'm missing something, knowledge-wise, when it comes to variables. I would appreciate if anyone could help me wrap my head around the subject and the reasons behind the different results.

Thanks

see below for a print screen of the diff, results, all 3 contained solely the same  $(vGlobal_Ranking) variable

Global Ranking.png

4 Replies
vishsaggi
Champion III
Champion III

What is the expression you are using in your variable. Can you share a sample app to look into. May be in your table is it is calculating distinct values based on your dimensions. Can't answer until I see some sample data. Is it possible?

marcus_sommer

The difference will be that the calculation within the table is in respect to the dimensions there and within the gauge or KPI it's without any dimension.

- Marcus

andrei_delta
Partner - Creator III
Partner - Creator III

Hello,

When you are making the KPI and you are calling the variable it calculates the formula globally and doesn;t aggregate to anything unless you do it inside of it.

The expression you are calculating aggregates to dimension that you use in the table.

Hope it helped,

Andrei

Anonymous
Not applicable
Author

ok, thanks