Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, In my application so many CASE statements have been used to extract the data from database at script level. But today I got requirement that need to replace CASE statements with qlik functions. But I am not able to find that. Could you please some one help me?
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
case when (((Eleven_Tables44.COMP_NUMBER = 1) and (Eleven_Tables44.RESULT_TYPE = 'T3')) or ((Eleven_Tables44.UNIT_NUMBER = 1) and (Eleven_Tables44.RESULT_TYPE = 'T4'))) then Eleven_Tables44.PRIMARY_LIMITS else '' end as PRIMARY_LIMITS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I tried with If Condition, but the data is not coming correctly.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
IF(((COMP_NUMBER=1 AND RESULT_TYPE='T3') OR (UNIT_NUMBER=1 AND RESULT_TYPE='T4')),PRIMARY_LIMITS,'') AS PRIMARY_LIMITS_1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thank you.
The transalation of SQL to Qlik script you did is correct, i wouldn't do it in a different way...
Is it possible that your data when they are downloaded to Qlik are somehow affected in a way?
try this
if((Eleven_Tables44.COMP_NUMBER = 1 and Eleven_Tables44.RESULT_TYPE = 'T3')
or (Eleven_Tables44.UNIT_NUMBER = 1 and Eleven_Tables44.RESULT_TYPE = 'T4'), Eleven_Tables44.PRIMARY_LIMITS, '')
you can use pick match like following syntax
pick(match("COMPANY_NAME",'A','B','C',"COMPANY_NAME"),'COMP A','COMP B','COMP C') as COMP,
Vikas
Hi Vasiliy, I tried your code, but it is not working. Still the data is not matching. Thank you.
Hi Vikas, Can you please elaborate, How will use pick match here.