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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ramon1
Contributor
Contributor

Managing dynamically expressions regarding the dimension

Hello,

On a pivot table (on Sense), I have a list of kpi's names (in a island table) , for each one I need to calculate yearly value (col1), average (col2) etc...

So, on each expression, I have a collection of "if" like : 

if( kpi=aa, [master item1], if kpi=bb, [master item2] and so on

You can easily guess that the performance isn't great. Is there any way to avoid this kind of expression ? ( I tried expression stored in a field of the kpi table, variables with the same name of kpi etc... ) 

The best would be an expression like  [ master item 'name of dim1' ] or =$(=var_ name of dim1)

The table is exactly how users want to see it 

Labels (1)
  • SaaS

1 Reply
SunilChauhan
Champion II
Champion II

Load in Excel   as two column  KPI Name and expression.

Load Using Loop like below

 

Var:

LOAD KPI  ,

     Exp

FROM

filename.xlsx

Let vNoOfVar = FieldValueCount ('KPI') ;
For i = 0 to $(vNoOfVar )-1

  Let vKPI = Peek('KPI',$(i),'Var');

  Let $(vKPI ) = Peek('Exp',$(i),'Var');

Next i

 

 

Drop Table Var;

Sunil Chauhan