3 Replies Latest reply: Dec 30, 2016 8:08 AM by Ruben Marin RSS

    Convert to set analysis

    gaurav gopale

      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

        • Re: Convert to set analysis
          Ruben Marin

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

            • Re: Convert to set analysis
              gaurav gopale

              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
                  Ruben Marin

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