Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all ,
swuehl,M G,Peter Cammaert,jagan mohan rao appala,Marco Wedel
How to change the below if statements to case statements?
Anyone help me on this.
If(MATCH_TYPE='VOD', 'Tier 1',
If(NOT MATCH_TYPE(NETWORK_TYPE,'Broadcast','Cable') AND NOT IsNull(PROGRAM_NAME),
If(Num#(Left(TIMESHIFT_INDICATOR_ID,2)) >= 10 AND Num(Left(TIMESHIFT_INDICATOR_ID,2)) <= 16
AND Count(Distinct USERS_META_ID) <> 0,'Tier 2','Tier 1')
)
) as Field_name
if(MATCH_TYPE = 'VOD','Tier 1',
if(MATCH_TYPE <> 'VOD' AND NETWORK_TYPE IN ('Broadcast', 'Cable') AND PROGRAM_NAME <> null,
if(TIMESHIFT_INDICATOR_ID = 10 AND SAMPLE <> 0,
if(TIMESHIFT_INDICATOR_ID = 11 AND SAMPLE <> 0,
if(TIMESHIFT_INDICATOR_ID = 12 AND SAMPLE <> 0,
if(TIMESHIFT_INDICATOR_ID = 13 AND SAMPLE <> 0,
if(TIMESHIFT_INDICATOR_ID = 14 AND SAMPLE <> 0,
if(TIMESHIFT_INDICATOR_ID = 15 AND SAMPLE <> 0,
if(TIMESHIFT_INDICATOR_ID = 16 AND SAMPLE <> 0,'Tier 2','Tier 1')))))))))
as field_name
Message was edited by: suri qv
Hey Suresh, Are these two different if statements or the same done differently?
two differnt stemnts sunny... tried with two ways....
sry two r same done in diffrnt ways...
When you say change the if statement to case statement, I am getting confused about which one is the one we need to change to case (besides does QlikView even has a case statement? never seen anybody use it )
hmmm.. dat fr in Qliksense. and two stnts to get ouput same value....tryng to do by usng case stmnts sunny...
please help me how to convert that stmnt to case in general.
I guess, I am going to leave this for other experts, as I have no expertise in using Case Statement. I look at this as an opportunity to learn something new. All the best
sunny.........thnx for info sunny...u r rock always...thaliva.
Hi sunny,
The first one will be better to convert. This post is raised by my friend
Try the below one,
if(MATCH_TYPE = 'VOD','Tier 1',
if(MATCH_TYPE <> 'VOD' AND Match(NETWORK_TYPE,'Broadcast', 'Cable') AND Len(Trim(PROGRAM_NAME)) <> 0,
if((TIMESHIFT_INDICATOR_ID >= 10 AND TIMESHIFT_INDICATOR_ID <= 16) And SAMPLE <> 0,
'Tier 2','Tier 1')))
As Field_Name