7 Replies Latest reply: Feb 12, 2018 6:51 AM by satish rathod RSS

    Selection from Starting Date to Selected Date

    satish rathod

      Hello Everyone,

          I want an expression for Sum(Sales) from Starting Date to Selected Date where a user selects Year, Month and Day.

      Suppose a Date (MM-DD-YYYY) 1/22/2017 is selected (I have data from 1/1/2010), then the Sum(Sales) should be from Start date (1/1/2010) till 1/22/2017.

       

      The Expression in the Data Load Editor is as Given below:

       

      LOAD

          "Date",

          Month("Date") as Month,

          Year("Date") as Year,

          Day(Date) as "Day1",

          Sales,

          Floor("Date") as DateNum

      FROM [lib://Folder/Sales data.xlsx]

      (ooxml, embedded labels, table is Sheet1);

       

      I have an expression

      if(GetSelectedCount(Date)>0,sum({$ <Date={"<=$(=max(Date))"}> } Sales),Sum({<Date = {">=$(=YearStart(Date))<=$(=Date(Max(Date)))"} >} Sales))


      This expression gives the correct result when "Date" field is selected.

      I want the correct result when the "Year", "Month" and "Day1" fields are selected not the "Date" field.

      Cause in the Main Dashboard, The "Date" filter will not be present. Only the "Year", "Month" and "Day1"  filter will be present