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

QTD calculation in script

Hi All,

I am getting MTD and YTD data directly from the user (source excel file), however user requested me to develop QTD in Qlik sense script.

Could someone guide me with this?

Thanks for the support in advance.

Regards

Nakul

Labels (2)
3 Replies
jwjackso
Specialist III
Specialist III

I just recommended Henric's As-Of-Table for another solution, but it should help you as well.

nakuldev
Creator
Creator
Author

Thank you for the response Jackson!

The issue is, dashboard was already in production, now I can't do any changes to the charts.

Thanks

Nakul

jwjackso
Specialist III
Specialist III

In a chart, your QTD can be as simple as

Jan-QTR1 = Sum({<Year={'2021'},Mth={'Jan'}>}Sales)

Feb-QTR1 = Sum({<Year={'2021'},Mth={'Jan','Feb'}>}Sales)

Mar-QTR1 = Sum({<Year={'2021'},Mth={'Jan','Feb','Mar'}>}Sales)

Apr-QTR2 = Sum({<Year={'2021'},Mth={'Apr'}>}Sales)

The YTD

Jan-YTD = Sum({<Year={'2021'},Mth={'Jan'}>}Sales)

Dec-YTD = Sum({<Mth={'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'}>}Sales)