Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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 ~