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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Iwin
Partner - Creator
Partner - Creator

Value becomes null on selection but without selection shows correct values

Hi ,

I want to show values for sales which will have selected month -1 values and without any selection for month will show max month-1 values.

Expression i have used is as below:

sum({<Date={">=$(=Monthstart(addmonths(max(Date),-1)))<=$(=Monthend(addmonths(Max(Date),-1)))"}>}Sales_Derived)

However value is correctly showing without any month or Year selection,

But when i select a Year or month no value is shown.

What could be the issue here?

Thanks

Labels (4)
1 Reply
Umberto
Support
Support

Hello, 

Your expression looks good, provided you are using a Master Calendar table rather than an Autocalendar .

I would refine the expression by forcing the format with the function Date as follows (use the format which best suits your timezone) 

sum({<Date={">=$(=Date(Monthstart(addmonths(max(Date),-1)), 'M/D/YYYY'))<=$(=Date(Monthend(addmonths(Max(Date),-1)), 'M/D/YYYY'))"}>}Sales_Derived)

I tested on my side and with that tiny change it works fine.

I hope it helps.