Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rolling 3,6,12 months Calculation

Hi all,

I need help for some calculations.

In my Dashboard I filtered one year of data, and I need to calculate the sum value stock of warehouse that moved > 3 Months, ❤️ Months, > 6 Months and > 12 Months.

How can i do?

Thank you so much.

Francesca

7 Replies
sunny_talwar

May be this link can help you: YTQ, QTD, MTD and WTD

Best,

Sunny

abhaysingh
Specialist II
Specialist II

Hi Francesca,

What is the logic to calculate >3Month, <3Month etc??

try this may help you, will give you last three month stock

=sum({< month = { '$((today()-3))'}>}Stockvalue)



thanks

sunny_talwar

=sum({< month = { '$((today()-3))'}>}Stockvalue)

Abhay, I don't think the above will give him last 3 months stock. Today() - 3 is three days back. Did you forget to add Addmonths??

abhaysingh
Specialist II
Specialist II

yeah sory pls add addmonths

=sum({< month = {'$(Addmonths(Today()),-3)'}>}Stockvalue)

sunny_talwar

I would further adjust it to this:

=Sum({<MonthYear = {"$(='>=' & MonthName(AddMonths(Today(),-3)))"}>} Stockvalue)



Where MonthYear is a field created in the script using MonthName() function

[Master Calendar]:

LOAD Date,

          Year,

          MonthName(Date) as MonthYear

          ...

Resident...;

anu
Partner - Contributor III
Partner - Contributor III

Hi,

Thanks for the post,

=Sum({<MonthYear = {"$(='>=' & MonthName(AddMonths(Today(),-3)))"}>} Amount) 

I'm using above measure in a bar chart with dimension as MonthYear and measure column as Amount, but it is not working , showing me a blank chart.

martinpohl
Partner - Master
Partner - Master

I think,

Set analysis won't work with monthname and <= or >=

use

=Sum({<Datefield= {"$(='>=' & date(AddMonths(Today(),-3)))"}>} Amount) 

instead