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

Query help

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

4 Replies
ThornOfCrowns
Specialist II
Specialist II

As in a Loadscript?

Not applicable
Author

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 .

vijetas42
Specialist
Specialist

After your database connection string you can write down same query as it is after that in edit script

vijetas42
Specialist
Specialist

If case statement is not working then please use wildmatch() instead of case and also refer this link http://community.qlik.com/thread/53601