Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

paulyeo11
Valued Contributor II

How to add one more var ?

Hi All

I have learn from below post :-

QS How to combine 2 Revenue and Net Profit Table into 1 Table ?

The solution for above is using script :-

Pick(Match($(Var),1,2),Sum({<rEVENUE={"rEVENUE"}>}Amount)/1000,Sum({<nET_PROFIT={"nET_PROFIT"}>}Amount)/1000)

it look very simple  because i can convert the above script to below :-

Pick(Match($(Var),1,2)

,Sum({<rEVENUE={"rEVENUE"}>}Amount)/1000

,Sum({<nET_PROFIT={"nET_PROFIT"}>}Amount)/1000)

So in order for me to add one more variable , for example cOST.

Step 1 I go to the variable Add , Value = 3 Label = cOST

Step 2 I modify the the above script to below :-

Pick(Match($(Var),1,2)

,Sum({<rEVENUE={"rEVENUE"}>}Amount)/1000

,Sum({<nET_PROFIT={"nET_PROFIT"}>}Amount)/1000)

,Sum({<cOST={"cOST"}>}Amount)/1000)

That it , and i am confident it will work fine , But to my surprise it never work. and i don't know why ? May be Andy will know.

Paul

2 Replies
paulyeo11
Valued Contributor II

Re: How to add one more var ?

Hi All

I forgotten to memtioned that i also need to change :-

Pick(Match($(Var),1,2,),

To :-

Pick(Match($(Var),1,2,3),

Which i did , but still not work.

Paul

paulyeo11
Valued Contributor II

Re: How to add one more var ?

Hi All

Enclosed my QVF file , Hope some one can advise me.

Paul