Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create a table containing variable values and compute results

Dear Qlikview Experts.

I would like to do something like this;

Step 1

SET Var1 = Col1;

SET Var2 = Col2;

Let us say for example the result of Var1 = 1000 and  Var 2 = 2000.

Then Create a table like this:

Step 2

NumberCol    VarCol

10                    Var1

20                    Var2

30                    Var1

40                      Var2

Then I would like to do some pivot table calculation based on this table like this:

Step 3

DIM              EXPRESSION

NumberCol    NumberCol+VarCol

I want to see the following result.

DIM  EXPRESSION

10          1010

20          2020

30          1030

40          2040


I am attaching a file here. As you can see I can get the pivot1 derived from Table3 in the script working. But Pivot2 derived from Table4 is not working.

Can someone help me achieve this?

Thank you very much in advance.

Regards,

KS

3 Replies
Gysbert_Wassenaar

Use this expression: =NumberCol + Pick(match(VarCol,'Col1','Col2'),Col1,Col2)


talk is cheap, supply exceeds demand
Not applicable
Author

Fantastic. That works. Thank you very much Gysbert. I have attached the solution.

rgvavihs
Specialist
Specialist

try this

let Var1 =1000;

LET Var2 =2000;

T1:

load Number+VarCol as New,

Number;

LOAD *

Inline [

Number,VarCol

10    ,     $(Var1)

20     ,    $(Var2)

30      ,   $(Var1)

40       , $(Var2)

]