1 Reply Latest reply: Dec 6, 2012 6:22 AM by Gysbert Wassenaar RSS

    variable help

    Chris Hopkins

      Hi Everyone,

       

      I have the foloowing variable..

       

      LET vTargetSum_DistributionChart =

      'avg({1<

              [it_target_type]={"Distribution"},

              it_objective_name={'&CHR(36)&'(v_it_objective_name_selections)},

              territory_region={'&CHR(36)&'(v_territory_region_selections)},

             JOIN_territory={'&CHR(36)&'(v_JOIN_territory_selections)}

      >}

             [it_target_value]

      )';

       

      I want to add in some logic but un sure on how to do it.

      basically if the result of the above is NULL then i want to show it as 0.

      Can anyone help on how to incorporate this into the above variable please?

       

      Thanks

        • Re: variable help
          Gysbert Wassenaar

          Try using the alt function:

           

          LET vTargetSum_DistributionChart =

          'alt(avg({1<

                  [it_target_type]={"Distribution"},

                  it_objective_name={'&CHR(36)&'(v_it_objective_name_selections)},

                  territory_region={'&CHR(36)&'(v_territory_region_selections)},

                 JOIN_territory={'&CHR(36)&'(v_JOIN_territory_selections)}

          >}

                 [it_target_value]

          ),0)';