6 Replies Latest reply: Mar 2, 2017 10:54 AM by Thomas Ødegaard RSS

    IF Statement inside Set Analysis

    Thomas Ødegaard

      Hi all,

       

      I want my expression to show the sales amount of the latest month if no months are selected (Field: DW_SK_Date). However, if one or multiple months are selected the expression has to show the selected months.

       

      I have a field (IsCurrent) that specifies if it is the latest month (ISCurrent=1) or not (ISCurrent=0).

       

      I have tried to make a variable with the IF Statement and then put it into a set expression (see below), but it does not work.

       

      Can someone please help me out?

       

      Variable: vISCurrent = IF(GetSelectedCount(DW_SK_Date)=0,1,0)

       

      Set Expression: Sum({<IsCurrent={$(vISCurrent)}>}Amount)

       

      Please see my test dataset attached

       

      Kind Regards,

      Thomas