Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use sql case-when with multiple variables from different tables , and store into new variable in qlikview

I am trying to create new variable "new_var" base on condition that derived from 2 variables / 2 different tables in sql .. so If I use sql I would use something like :

select id,

         case when a.v1 in (1,2,3) then 'x'

                 when b.v2 in (1,2,3) then 'y'

         end as new_var

from  a

join  b on a.id = b.id

I'm new to qlikview , so now I have to get two different tables to two different loads using these below

T_a:

load id , v1;

sql select id, v1

     from a;

store T_a into T_a.qvd(qvd);

T_b:

load id , v2;

sql select id, v2

     from b;

store T_b into T_b.qvd(qvd);

Is there a way I can create "new_var" based on variabvle v1 from table a & variable v2 from table b to get "new_var" ?

Thank you ~

0 Replies