# 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
Did you mean:
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)
• ### Set Analysis

1 Solution

Accepted Solutions
• 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.
4 Replies

what is error you are getting?

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

Hi,

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

• 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.
Contributor
Author

Thanks alot,

It worked like a charm

Tags
Community Browser