Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
satish25
Contributor III
Contributor III

Selection from Starting Date to Selected Date

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



11 Replies
rammuthiah
Creator III
Creator III

Did you get the result for your requirement?
Shivesh-Sinha
Partner - Contributor
Partner - Contributor

@OmarBenSalem This old post of yours helped me big time. Thanks for sharing this in community!