Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Lionel_Maximus
Contributor III
Contributor III

Month To Day Sales

Hello,

I have four months of sale.......I have a filter-pane with Months and Days in it.

What I want:

When i select Any Day in the filter pane......It should show the sales in every month till that day. How to do it???

Thanks

"Sample Data Is Attached"

1 Solution

Accepted Solutions
Lionel_Maximus
Contributor III
Contributor III
Author

Thank You  All.

The Sloution is :

Previous Month Sale:

Sum({1<Month={'$(PreMonth)'},Day={"<=$(MaxDay)"}>}Sales)

PreMonth = =Month(Max(VDate)) -1

Current Month Sale:

Sum({1<Month={"$(=Max(Month))"},Day={"<=$(MaxDay)"}>}Sales)

View solution in original post

12 Replies
OmarBenSalem

u have 2 filter panes with 2 fields? Days and Month?

Or one filter pane with one field? Day-Month?

Lionel_Maximus
Contributor III
Contributor III
Author

I have 2 Filter Panes with fields.....Month & Day

Channa
Specialist III
Specialist III

=Sum({$<[Ship Date]={">=$(MonthStart(passselcted month))<$(=monthend(passselcted month)"}>}Sales)

 

 

 

Channa
Channa
Specialist III
Specialist III

Hi I attach qvf 

it has two dates try to have date between those 2 dates

 

start date of selected month

=MonthStart(max(Date))

 

today of selected month

=date(num(Month(max(Date)))&'/'&day(today())&'/'&year(max(Date)))

 

create those two variables and take date between those

Channa
OmarBenSalem

sum({<Month, Day={"<=$(=max(Day))"}>}Value)

Channa
Specialist III
Specialist III

1st wile loading date just do date(Date) as DateS

 

2nd  create variable vMonthStart

=MonthStart(max(DateS))

 

3rd create variable to get current date vCurrentDate

=date(num(Month(max(DateS)))&'/'&day(today())&'/'&year(max(DateS)))

 

4th add below in test box

=Sum({$<DateS = {">=$(vMonthStart)<=$(vCurrentDate)"}>}Sales)

 

it is working i am not able to attach qvf

 

 

Channa
Channa
Specialist III
Specialist III

the above solution will take today of selected month

 

if you want to pass selected date just pass date into vCurrentDate=DateS

 

 

Channa
Channa
Specialist III
Specialist III

try the sample attached

Channa
Lionel_Maximus
Contributor III
Contributor III
Author

Hello,

Thank you for the solution but it is giving the wrong answer.....e.g. I don't have the sales in Sep,Dec but when i select either one of those it gives me sale.