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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
rsdhavle
Creator III
Creator III

Calculations of latest data based on year and month dimensions

I have data which is dymnamic and i wanna calculate revenue based on latest month of latest year.

Lets say current data is till february 2014 so revenue should be calculated based on feb 13 when the march data will get added it should be calculated on the basis of march 2014

What formula should be used.

PS: I dont have any date field in the data. Only year and month are the two fields for time period

1 Reply
Anonymous
Not applicable

Hi,

I would store the current data month in a variable vMonthCalculation and then use this variable as a condition in the script.

for instance:

Temp:

LOAD

     Max(Month) as MaxMonth,

     Max(Year) as MaxYear

FROM table

GROUP BY Year;

LET vMonthCalculation = Peek('MaxMonth',0, 'Temp');

DROP TABLE Temp;

Then you load the necessary calculation with the vMonthCalculation as a constraint.

Hope this helps,

E