Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
gauravgg
Partner - Creator
Partner - Creator

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

3 Replies
rubenmarin

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
Partner - Creator
Partner - Creator
Author

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])

rubenmarin

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])