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: 
Rose1
Contributor II
Contributor II

How to compute 12 months value ?

Hello , I want to compute the values of 12 months when choosing one month without displaying the 11 previous month .

For example : If I choose Aug 2019 I want to get the sum of values between Aug 2018 and Aug 2019 but without seeing the value of each month 

Here is my expression :

 count({<MonthYear ={"$(='>=' & Date(AddMonths(Max(MonthYear), -12), 'MMM-YY') & '<=' & Date(Max(MonthYear), 'MMM-YY'))"}>}distinct VProducts).
Any Help would be appreciated .

Labels (1)
9 Replies
Anil_Babu_Samineni

What is VProducts?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Rose1
Contributor II
Contributor II
Author

The name of one of my rows in my table 

Anil_Babu_Samineni

I can understand that it is the field name, If so try this way

count({<MonthYear ={">=$(=Date(AddMonths(Max(MonthYear), -12), 'MMM-YY'))<=$(=Date(Max(MonthYear), 'MMM-YY'))"}>} distinct VProducts)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Rose1
Contributor II
Contributor II
Author

Thank you for your help , but I ve done it before it's not giving me what I want . 

It displays the 12 months with the value of each month what I want is the sum of the 12 months values  in one column.  

For example if I choose  oct-20 my  result in the pivot table would be the sum of sep 2019 value till oct 2020 

Anil_Babu_Samineni

Where are you trying this, Is this KPI or some chart? If chart what is the dimension?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Rose1
Contributor II
Contributor II
Author

Pivot table ,  my dimendion is MonthYear

Anil_Babu_Samineni

If that is the case, You won't get only single row. But, If i misunderstand the requirement you can explain more the expected result at least image?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Rose1
Contributor II
Contributor II
Author

Hello again ,  

Actually I used A different formula and get the result I was expecting to get but I only have on small issue I don't want those months with null values to be displayed , I tried to uncheck include the null value in my dimension MonthYear but it didn't worked  

THIS IS MY EXPRESSION 

Rangesum(before(Total count({<MonthYear>}distinct CLAIM_NUMBER),0,12)) * Avg(1)12.PNG

thank you 

Rose1
Contributor II
Contributor II
Author

Does anyone by chance solved the same problem I am having?