Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Lili123
Contributor
Contributor

Show sales between 2 dates

Hi, 

I need to show sales that between 2 dates.

First date is the 1.1 of the specific year that is selected

Last date is the last day of the previous month that was selected

Example - I selected day 1 -10, month May, Year 2022.

So in this case I want see sales for the period : 1.1.2022 - 30.4.2022. The issue that I want to see sales that are out of range that is selected (1.05.22 - 10.05.22).

=Sum({<Date=,Day=,Month=,[Date] = {">=$(=Date(YEARSTART(vSelectedDate)))<=$(=Date(MONTHEND(AddMonths(Max([Date), -1))))"}>} [SALES])

The result is the same for every month, I think because this on (Month=), but if I don't put it the result is not correct too, since months that I need are excluded.

I don't really know if it is possible.

I try it, but it is not working.

Please advise.

 

 

Labels (1)
1 Reply
Dalton_Ruer
Support
Support

So in this case I want see sales for the period : 1.1.2022 - 30.4.2022.  --- Makes perfect sense and is easily doable.

The issue that I want to see sales that are out of range that is selected (1.05.22 - 10.05.22).  --- Not sure I understand where these dates came from. Does this mean you want to use a filter to choose the Start Date and a filter to choose the End Date and then get the sales for that range?