Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
Can any one tell me how to write case statement with COALESCE in qlikview. please convert below below sql code in to qlik
CASE
WHEN (COALESCE(INCIDENT.Incident_ID,0) > 0)
THEN 'TRUE'
ELSE 'FALSE'
END AS FLAG,
Thanks,
Chinnu.
=if(INCIDENT.Incident_ID > 0, 'Yes', 'No' )
For checking null there is the isnull() function
where isnull(Incident_ID=0)
Hi,
u can write like this,
if( INCIDENT.Incident_ID >0 , 'TRUE','FALSE') AS FLAG,
COALESCE mean not null values? if so then try like below,
if( INCIDENT.Incident_ID >0 and len(INCIDENT.Incident_ID)>0 , 'TRUE','FALSE') AS FLAG,
and also u can use below way for not null
Not IsNull(INCIDENT.Incident_ID)
Regards,
Deva
Hi P M,
Thanks for your quick reply if I am using the above syntax I am getting only true values. I am not getting false values
Thanks,
Chinnu.
For numerics, the equivalent function to SQL COALESCE in QV is Alt():
If(Alt(INCIDENT.Incident_ID, 0) > 0, 'TRUE', 'FALSE' )
Note that the QV is not totally the same as COALESCE because COALESCE works with non-numeric types as well, while the QV Alt() function only handles numerics.
as @jonatham suggest
Please try this
If(Alt(INCIDENT.Incident_ID, 0) > 0, 'TRUE', 'FALSE' )