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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
MR_Challaa
Contributor
Contributor

SET ANALYSIS

I HAVE ONE YEAR DATA.

HOW TO GET SUM OF SALES FOR THE LAST 6 MONTHS IN A TEXT OBJECT.

AND 

 WE  SHOULD NOT DO ANY CHANGES IN SCRIPT LEVEL.

 

REGARDS

2 Replies
lironbaram
Partner - Master III
Partner - Master III

Hi,
You can use something like this.
Assuming you have a Date field called DateField.

sum({<DateField={">=$(=monthstart(addmonths(max(DateField),-5))"}>}Sales)
anthonyj
Creator III
Creator III

Hi,

You can add a measure in you text object without any changes to the model. The measure would look like this.

sum({$<DateField={">=$(=monthstart(today(0),-5))"}>}Sales)

Regards

Anthony