Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

gauravgg
New Contributor III

Convert to set analysis

count(If([SOF Type]='Offline'  and [stat_id_pk]<>5 and [stat_id_pk]<>6 ,

if([serv_under_implementation_qty]<>0 or [serv_pandding_qty]<>0 or [serv_to_be_cancelled_qty]<>0 or

[serv_to_be_deactivated_qty]<>0 or [serv_under_deactivation_qty]<>0,

[SOF Number])))

I want to convert above expression in set analysis

Thanks in advance

Tags (1)
3 Replies

Re: Convert to set analysis

Hi guarav, creating one field in script that does the last checks (all those <>0) can help a lot;

if([serv_under_implementation_qty]<>0 or [serv_pandding_qty]<>0 or [serv_to_be_cancelled_qty]<>0 or

[serv_to_be_deactivated_qty]<>0 or [serv_under_deactivation_qty]<>0, 1, 0) as Active_qty

Count({<[SOF Type]={'Offline'}, [stat_id_pk]=P([stat_id_pk])-{'5','6'}, Active_qty={1}>} [SOF Number])

gauravgg
New Contributor III

Re: Convert to set analysis

thanks Ruben

i also want to add following condition

count({-$<O_Date={'>=$(=Date(WeekStart(Max(O_Date), 0, 0),'DD/MM/YYYY'))<=$(=Date(WeekEnd(Max(O_Date), 0, 0),'DD/MM/YYYY'))'}>}CustomerID)


in


Count({<[SOF Type]={'Offline'}, [stat_id_pk]=P([stat_id_pk])-{'5','6'}, Active_qty={1}>} [SOF Number])

Re: Convert to set analysis

Not sure how to want to include the count... are you refering just to the same set analysis? Maybe:

Count({<[SOF Type]={'Offline'}, [stat_id_pk]=P([stat_id_pk])-{'5','6'}, Active_qty={1}>-<O_Date={">=$(=Date(WeekStart(Max(O_Date), 0, 0),'DD/MM/YYYY'))<=$(=Date(WeekEnd(Max(O_Date), 0, 0),'DD/MM/YYYY'))"}>} [SOF Number])


or


Count({<[SOF Type]={'Offline'}, [stat_id_pk]=P([stat_id_pk])-{'5','6'}, Active_qty={1}, CustomerID=P({-$<O_Date={">=$(=Date(WeekStart(Max(O_Date), 0, 0),'DD/MM/YYYY'))<=$(=Date(WeekEnd(Max(O_Date), 0, 0),'DD/MM/YYYY'))"}>}CustomerID)>} [SOF Number])