6 Replies Latest reply: May 7, 2015 9:54 PM by susvithrocks susvithrocks RSS

    Selecting single MonthYear expression not working

    James Kerrigan

      Hey guys,


      What I'm trying to do seems like it should work, but doesn't seem to be.


      I'm trying to set up my line chart so that when only a single month is selected, the chart isn't filtered at all.

      ie. Min(MonthYear) = Max(MonthYear)


      So if I select Oct-14 in the chart, Oct-14 is both the min and the max MonthYear value.


      But if I select a range of months, Oct-14 to Dec-14, the min and max MonthYear value are different.


      So what I've done is make a simple if statement.


      If(min(MonthYear) = max(MonthYear), Sum({$<MonthYear=>}Price), Sum(Price))


      But it doesn't seem to be working. Instead of Sum({$<MonthYear=>}Price) being executed when a single MonthYear is selected, Sum(Price) is. But seems to be working fine when more than one MonthYear is selected.


      My MonthYear is in the load statement as so:


      Date(monthstart(TempDate), 'MMM-YY') AS MonthYear


      Thanks in advance!