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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
QlickySense
Creator
Creator

How to add third column to the crosstable

Hello,

I have a variable A which takes values from 1 to 3. These needs to be calculated like if varA 1 then multiply *0.25, 0.5 for 2 and 0.75 for 3

What I would like to achieve in crosstable is to have 3 columns: 1 Unique Type,  Variable A values, and Result value of Variable

It would look like:

Type,  Var A,         Result

A,            1,               0,25

A,           3,                2,25

B,          3,                2,25

A,          2,                 1

 

and so on

 

tried

 

CROSSTABLE(x,y)
Load
Type,
Val A,
if(var_A = 1, var_A *0.25, If(var_A = 2,C4br2*0.5, If(var_A=3, var_A*0.75))) as Result
FROM x.csv;

 

but didnt work

Labels (2)
0 Replies