Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
if(sum(if(DHVNHFProtocolCareStepPerfMeasures.DocDayAfterDischarge <= 2 and DHVNHFProtocolCareStepPerfMeasures.ApptConf = 'Y',1,0))>=1,'Y', sum(if(DHVNHFProtocolCareStepPerfMeasures.DocDayAfterDischarge > 2 and DHVNHFProtocolCareStepPerfMeasures.ApptConf = 'Y',1,0))>=1,'L',’N’)
it doesn't like my above set analysis expression for my qlik chart.. why?
Essentially I want it to mark all my appointments that are less or equal to 2 as a Y (Yes), if they were conducted BUT over 2 days then a L (or late) and if they were not done at all as N (or NO).. can I do this the way I'm writing it?
Can you share some sample data with expected output please?
Try this one
if(DHVNHFProtocolCareStepPerfMeasures.DocDayAfterDischarge <= 2 and DHVNHFProtocolCareStepPerfMeasures.ApptConf = 'Y' ,'Y',
if(DHVNHFProtocolCareStepPerfMeasures.DocDayAfterDischarge > 2 and DHVNHFProtocolCareStepPerfMeasures.ApptConf = 'Y' ,'L','N'))
this is giving me a No (N) for ones that should be Yes (Y)
Right now I'm doing it in my SQL code instead and writing it like this... rather than within Qlik.
case when sum( case when ApptConf = 'Y' and DocDayAfterDischarge <= 2 then 1 else 0 end) >= 1 then 'Y'
when sum( case when ApptConf = 'Y' and DocDayAfterDischarge > 2 then 1 else 0 end) >= 1 then 'L'
else 'N' end as ApptConfFinal
OK so does this work as expected when you run from SQL?
Maybe try this
IF(
DHVNHFProtocolCareStepPerfMeasures.ApptConf = 'Y', /** Check for ApptConf **/
IF(
DHVNHFProtocolCareStepPerfMeasures.DocDayAfterDischarge <= 2, /** Appointments <2 days **/
'Y',
IF(
DHVNHFProtocolCareStepPerfMeasures.DocDayAfterDischarge > 2, /** Appointments >2 days **/
'L',
'N'
)
)
)
Thanks.