Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
Can any one please help me to convert below code to qlik
CASE
WHEN (COALESCE(intincident.incident_ID,0) > 0)
THEN 'TRUE'
ELSE 'FALSE'
END AS INTERNALFLAG,
incidentStat.INCIDENT_STAT_DESC AS INCIDENTSTATUS,
incident.INCIDENT_OPN_DT AS INCIDENTOPENDATE,
CASE
WHEN COALESCE(initialId.ID_FLG_A,'0') = '1'
THEN initialIdFlgDesc.ID_FLG_B
WHEN COALESCE(Service activity.ID_FLG_A, '0') = '1'
THEN Service activityDesc.ID_FLG_B
WHEN COALESCE(Remainder.ID_FLG_A,'0') = '1'
THEN RemainderDesc.ID_FLG_B
END AS TYPE,
Replace the COALESCE() with Alt() and the CASE with nested IF or Pick()/Match() as detailed in this post: My way of writing CASE WHEN ELSE statement
Why not extract it as it is?
Ex:
Table:
Load *;
SQL Select *,
CASE
WHEN (COALESCE(intincident.incident_ID,0) > 0)
THEN 'TRUE'
ELSE 'FALSE'
END AS INTERNALFLAG,
incidentStat.INCIDENT_STAT_DESC AS INCIDENTSTATUS,
incident.INCIDENT_OPN_DT AS INCIDENTOPENDATE,
CASE
WHEN COALESCE(initialId.ID_FLG_A,'0') = '1'
THEN initialIdFlgDesc.ID_FLG_B
WHEN COALESCE(Service activity.ID_FLG_A, '0') = '1'
THEN Service activityDesc.ID_FLG_B
WHEN COALESCE(Remainder.ID_FLG_A,'0') = '1'
THEN RemainderDesc.ID_FLG_B
END AS TYPE
FROM YOURDBSCHEMAANDTABLENAME;
Store Table into......qvd (qvd);