Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Ahmed_Hisham
Contributor
Contributor

Time range set analysis

Dears,

 

Kindly can any one help with this script to calculate 12 month sum

 

Sum({<[Month Date.autoCalendar.Year]=, [Month Date.autoCalendar.Month]=, [Month Date.autoCalendar.Date]={">=$(=date(MonthStart(Max([Month Date.autoCalendar.Date])),M/D/YYYY), -11))<=$(=Date(Max([Month Date.autoCalendar.Date]),M/D/YYYY))"}>} Qty )

 

The date in load editor is

SET DateFormat='M/D/YYYY';

Labels (1)
1 Solution

Accepted Solutions
PrashantSangle

  • Sum({<[Month Date.autoCalendar.Year]=, [Month Date.autoCalendar.Month]=, [Month Date.autoCalendar.Date]={">=$(=date(MonthStart(Max([Month Date.autoCalendar.Date]),-11),'M/D/YYYY'))<=$(=Date(Max([Month Date.autoCalendar.Date]),'M/D/YYYY'))"}>} Qty )

check above.. check all internal sets some of them incorrectly parameterised .

 

Great dreamer's dreams never fulfilled, they are always transcended.

View solution in original post

4 Replies
PrashantSangle

what is error you are getting?

Great dreamer's dreams never fulfilled, they are always transcended.
Ahmed_Hisham
Contributor
Contributor
Author

Hi,

 

it returns only the value of (=Date(Max([Month Date.autoCalendar.Date]),M/D/YYYY) not the sum of the range

 

 

PrashantSangle

  • Sum({<[Month Date.autoCalendar.Year]=, [Month Date.autoCalendar.Month]=, [Month Date.autoCalendar.Date]={">=$(=date(MonthStart(Max([Month Date.autoCalendar.Date]),-11),'M/D/YYYY'))<=$(=Date(Max([Month Date.autoCalendar.Date]),'M/D/YYYY'))"}>} Qty )

check above.. check all internal sets some of them incorrectly parameterised .

 

Great dreamer's dreams never fulfilled, they are always transcended.
Ahmed_Hisham
Contributor
Contributor
Author

Thanks alot,

It worked like a charm