Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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
Valued Contributor II

Re: Query help

As in a Loadscript?

Not applicable

Re: Query help

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 .

vijetasharma
Contributor III

Re: Query help

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

vijetasharma
Contributor III

Re: Query help

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

Community Browser