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

Current/ Previous Month/Quarter


Hi,

I have a Excel source with the time Dims with other Measures and calc Fields  as below;

Untitled.png

I want to dertermine the Latest and Previous Month and Latest and Previous Quarter calculation on a Chart.

Any help appreciated !

Thanks !

2 Replies
buzzy996
Master II
Master II

try tis

Current Month

=num(sum({$} Measure), '$#,##0;($#,##0)')

Previous Month

sum({$<Year = {$(=only(Year) - $(=if(only(Month) = 1, 1, 0)))}, Month = {$(=month(addmonths(MonthYear, -1)))}>} Measure)

current QTR

=num(sum({$<Year = {$(=only(Year))}, Quarter = {$(=only(Quarter))}, Month = {"<=$(=max(Month))"}>} Measure), '$#,##0;($#,##0)')

sunny_talwar

Personally I would flag the data in the script and use that in my set analysis statement o simplify things. A sample qvw would be helpful in order to explain it.

Best,

S