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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
suvechha_b
Creator III
Creator III

How to write the expression for YTD calculation ?

Hi All ,

Please find the expression below for the Actual Sales calculation :

Sum(Aggr(if(Measure='Quantity',SUM({<[Calendar Month]={'<=$(=Max([Calendar Month]))'},[Type Indicator] = {'A'} >} Quantity),if(Measure='Value',SUM({<[Calendar Month]={'<=$(=Max([Calendar Month]))'},[Type Indicator] = {'A'} >} [Sales Value]),if(Measure='AIMS Units',SUM({<[Calendar Month]={'<=$(=Max([Calendar Month]))'},[Type Indicator] = {'AIMS_SALES'} >} [Quantity]),SUM({<[Calendar Month]={'<=$(=Max([Calendar Month]))'},[Type Indicator] = {'AIMS_SALES'} >} [Sales Value])))),Measure,[Calendar Month],Month))

How the YTD Report

new.PNG

The Total Units

for sep should sum sales for month Jul,Aug and Sep ? and so on.

So, If I select [Fiscal Period]=3

The report should , show from Jul to Sep

and the Total Units should be

Jul           Aug                     Sep

5041        5041 +8124        5041 +8124+5072

And if I dont select any [Fiscal Period ]

The output :

Jul           Aug                     Sep                                               Jun

5041        5041 +8124        5041 +8124+5072 .........             5041 +8124+5072 .........  +9007

Sample attached.

10 Replies
suvechha_b
Creator III
Creator III
Author

Please can you help to get the Prev Yr Actuals .

See the question.

How to write the following expression ?

How to write the following expression ?