Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Theo_Westseit
Contributor III
Contributor III

Show the sum of the past 12 months

Hello Guys,

im looking for a way to show the sum of the past 12 months....
Somehow, the formula doesnt work:

Sum({<Date={">=$(=(Monthstart(addmonths(Today(),-12))))<=$(=MonthEnd(addmonths(Today(),-1))))"}, Country={"Italy"}>}Sales)

The retrieved values are not the correct result...their 10x times higher...as if they were multiplied with something...

Any ideas?
Thanks!

Labels (2)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

As below , replace YYYY-MM-DD to match the format of your date field

 

=Sum({<Date={">=$(=Date(Monthstart(Today(),-12),'YYYY-MM-DD'))<=$(=Date(Monthend(Today(),-1),'YYYY-MM-DD'))"}

, Country={"Italy"}>}Sales)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
edwin
Master II
Master II

i suggest start with a simple table where you have monthstart of date as dimension and just do a sum for Italy.  that could lead you to the issue 

vinieme12
Champion III
Champion III

As below , replace YYYY-MM-DD to match the format of your date field

 

=Sum({<Date={">=$(=Date(Monthstart(Today(),-12),'YYYY-MM-DD'))<=$(=Date(Monthend(Today(),-1),'YYYY-MM-DD'))"}

, Country={"Italy"}>}Sales)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.