Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I just need help in Query..
select tin,saleschannel,bookingsource,userid,seats,value,
case
when saleschannel='Online' and (userid is null or userid not like '%RB:MOBILE%') then 'ONLINE WEB SALES'
when saleschannel=online and userid like '%RB:MOBILE%' then 'MOBILE'
when userid like '%RB:MOBILE%' and userid not in ('RB:MOBILEWINDOWASAPP','RB:MOBILEADRIODAPP') then 'WAP SALES'
when userid like '%RB:MOBILE%' and userid in ('RB:MOBILEWINDOWASAPP','RB:MOBILEADRIODAPP') then 'APP SALES'
when saleschannel='corporate' and bookingsource='corporate' then 'offline agents'
when saleschannel='Corporate' and bookingsource='webdirect' then 'other offline agents'
end as channel
from temp_fact
how can i write this Query in Qlik view
Thanks
Kalyan
As in a Loadscript?
problem in
writing for the below lines
case
when saleschannel='Online' and (userid is null or userid not like '%RB:MOBILE%') then 'ONLINE WEB SALES'
when saleschannel=online and userid like '%RB:MOBILE%' then 'MOBILE'
when userid like '%RB:MOBILE%' and userid not in ('RB:MOBILEWINDOWASAPP','RB:MOBILEADRIODAPP') then 'WAP SALES'
when userid like '%RB:MOBILE%' and userid in ('RB:MOBILEWINDOWASAPP','RB:MOBILEADRIODAPP') then 'APP SALES'
when saleschannel='corporate' and bookingsource='corporate' then 'offline agents'
when saleschannel='Corporate' and bookingsource='webdirect' then 'other offline agents'
end as channel
i think case and is null or not in functions will not work .
After your database connection string you can write down same query as it is after that in edit script
If case statement is not working then please use wildmatch() instead of case and also refer this link http://community.qlik.com/thread/53601