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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date range in set analysis

Hi, hope all you clever guys out there could help with a piece of set analysis I'm struggling with

I'm trying to set a date range that looks from the beginning of this year to the last day of last month. This works fine, if I fix the dates as below.

=sum({<UNIT.SOLD_DATE= {">=01/01/2015 <=31/05/2015"} >} UNIT.TOTALSOLD)

But if I want to get Qlikview to recognise the last day of the last month automatically I did this but it doesn't work.

=sum({<UNIT.SOLD_DATE= {">=01/01/2015 <=(=date(today())-(day(today())"} >} UNIT.TOTALSOLD)

Thanks for any help, Simon

1 Solution

Accepted Solutions
sunny_talwar

Try this:

=Sum({<UNIT.SOLD_DATE = {">=01/01/2015<=$(=Date(Date(Today())-Day(Today()), 'DD/MM/YYYY'))"}>} UNIT.TOTALSOLD)

View solution in original post

8 Replies
avinashelite

try something like this :

=MonthEnd(MonthName(today())-1)

sunny_talwar

Try this:

=Sum({<UNIT.SOLD_DATE = {">=01/01/2015<=$(=Date(Date(Today())-Day(Today()), 'DD/MM/YYYY'))"}>} UNIT.TOTALSOLD)

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try:

=sum({<UNIT.SOLD_DATE= {">=01/01/2015<=$(=date(monthend(today(),-1),'DD/MM/YYYY'))"} >} UNIT.TOTALSOLD)


talk is cheap, supply exceeds demand
fvelascog72
Partner - Specialist
Partner - Specialist

Hi,

You can use MonthEnd(Today())

avinashelite

your final expression would be something like this:

=sum({<UNIT.SOLD_DATE= {">=01/01/2015 <=(=MonthEnd(MonthName(today())-1))"} >} UNIT.TOTALSOLD)

giakoum
Partner - Master II
Partner - Master II

you are missing the $ sign.

Gysbert's expression is safer as it also includes the format.

Not applicable
Author

That worked perfectly, thank you sunindia

sunny_talwar

Awesome