Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

cancel
Showing results for 
Search instead for 
Did you mean: 
Kenji_Masicat
Contributor III
Contributor III

How to Create YTD Gwt and P3 & P6 Ave

Hi,

 

I'm trying to compute for YTD gwt. My Order Date format is DD/MM/YYYY.

Also, how can I create measures for P3 months & P6 months?

Thanks a lot.

 

Kenji

 

1 Reply
bill_mtc
Partner
Partner

Just my two cents...

 

Create variables that would handle the maxYear, maxYearMonthNum, minlast3monthYearMonthNum

i.e variable value

for maximumYear = 2021

for maximumYearMonthNum = 202106

for minlast3monthYearMonthNum = 202104

 

Sample Data Set

bill_mtc_2-1631176303700.png

So having the two tables loaded, Calendar will use the "Date" column to connect/communicate with the Transaction's "Date" column.

 

Sample Report and Sample Formula

bill_mtc_3-1631176330141.png

 

YTD = Sum({<Year={maxYear}>} Amount)

Prev 3 months = Sum({<YearMonthNum={>minlast3monthYearMonthNum<=maxYearMonthNum}>} Amount)

 

It will always depends on the created data model, sometimes the simpler the data model the easier to create formula. Though, it is also case to case basis because the data model will always be based on the business process.