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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to manage calender selection?

Hi,

I want when I select Year as ' 2018' , Month as 'Jan and feb' and Date as '1st to 27th'. I should get total sales for 2018, for entire jan (31 days) and feb (27 days) ie.  total sales for 58 days .

How to do that ?

Please help paint1.png

12 Replies
Anonymous
Not applicable
Author

But total no. of days should be seen  as 58 in chart , so should i change the expression on total no. of days?

Anonymous
Not applicable
Author

I have following expression for sales

=num(sum({<year= {"$(=Max(year)-1)"}>} [inv value]/Sales_INR_Unit),'#,##0.0')

i have following expression for total no. of days

=num(count({< year = {"$(=Max(year)-2)"}>}DISTINCT Sold_Date),'#,##0.0')

ahmar811
Creator III
Creator III

if you have following expression for sales

=num(sum({<year= {"$(=Max(year)-1)"}>} [inv value]/Sales_INR_Unit),'#,##0.0')


"Date" is your date field which you consider as Calendar Date.

should be replace by below expression


=num(sum({<Date={">=$(=Date(MonthStart(AddMonths(AddYear(max(Date),-1),-1)),'DD-MM-YYYY'))<=$(=Date(AddYear(max(Date),-1),'DD-MM-YYYY'))"},Year=,Month=>}[inv value]/Sales_INR_Unit),'#,##0.0')



If you have following expression for total no. of days

=num(count({< year = {"$(=Max(year)-2)"}>}DISTINCT Sold_Date),'#,##0.0')

should be replace by below expression


=num(Count(DISTINCT {<Date={">=$(=Date(MonthStart(AddMonths(AddYear(max(Date),-2),-1)),'DD-MM-YYYY'))<=$(=Date(AddYear(max(Date),-2),'DD-MM-YYYY'))"},Year=,Month=>}Sold_Date),'#,##0.0')

I hope this will help you

Regards

Ahmar