Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to write below CASE statement into Qlikview
1)
SELECT DISTINCT TOP 4 [Type]
, 'FGType_Name' =
CASE
WHEN [Type] = 0 THEN 'SA'
WHEN [Type] = 1 THEN 'SE'
WHEN [Type] = 2 THEN 'IL'
WHEN [Type] = 3 THEN 'ST'
END
2)
CASE
WHEN left([No_],1) IN (3,4) THEN 'PL'
END AS [BSP]
3)
CASE WHEN No_ LIKE 'CE%' THEN '1' ELSE '0' END AS
FROM TEMP a
WHERE a.No_ IS NOT NULL AND a.No_ <> '';
THANKS
There is no CASE statement to use within a LOAD statement in QlikView, but you can use other conditional functions like pick()
Pick(Type+1, 'SA','SE','IL','ST')
or nested if() .
There is no CASE statement to use within a LOAD statement in QlikView, but you can use other conditional functions like pick()
Pick(Type+1, 'SA','SE','IL','ST')
or nested if() .
you can use pick & match like this
=pick(alt(match(Only(_DemandDays), 30, 60, 90, 180, 360, 365) , 0)+1,
'Mixed Demand',
'Demand 30 Days',
'Demand 60 Days',
'Demand 90 Days',
'Demand 180 Days',
'Demand 365 Days',
'Demand 365 Days')
The other 2 cases can be done like this:
2) If(Match(Left([No_], 1), '3', '4'), 'PL') as [BSP]
3) If([No_] like 'CE*', 1,
If(Len(Trim([No_]))>0, 0) as //To check it has value and it's not an empty value (if it's not in the Where clause)
Case Statement is not available in qlikview instead of this we need to use PICK & MATCH
Vikas
Perhaps the use of a mapping table and the applymap function could be looked at? Alternatively, use if statements in your script...
Hi swuehl,
Thanks for your reply ..
How can i use TOP function for Pick(Type+1, 'SA','SE','IL','ST') in this.
In this table we have many records that for I used first function also but using that I am unable to achieve result
for this (Pick(Type+1, 'SA','SE','IL','ST'))
Thanks
Hi, I'm not sure to understand your issue, I think it should work, you tried something like?:
First 4
LOAD Pick....