Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Pallabi77
Partner - Contributor
Partner - Contributor

Standard expression for last twelve months

I have a scenario , need to prepare a standard expression for 

1.Monthly

2. YTD

3.Last twelve months

sum({<$(vCYPeriod),Scenario={'CPL_ACT'}>}Value) [STANDARD FORMULA]

vCYPeriod=Pick(match($(vPeriodType),1,0,2),vPeriodTypeCYMTH,vPeriodTypeCYYTD,vPeriodTypeLast12Months)

vPeriodTypeCYMTH=[Fiscal year]={'$(=$(vCurrYear))'},[Posting period]={'$(=$(vCurrMonth))'}

vPeriodTypeCYYTD=[Fiscal year]={'$(=$(vCurrYear))'},[Posting period]={"<=$(=$(vCurrMonth))"}

vCYPeriod changes as per I select the variable as Monthly,YTD and Last twelve months. For Last twelve months the formula  is

<[Fiscal year]={'$(=$(vLast12MonthsStartYear))'},[Posting period]={">=$(=$(vLast12MonthsStartMonth))"}> + <[Fiscal year]={'$(=$(vCurrYear))'},[Posting period]={"<=$(=$(vCurrMonth))"}>

vLast12MonthsStartMonth if($(vCurrMonth)=12,1,$(vCurrMonth)+1)
vLast12MonthsStartYear if($(vCurrMonth)=12,$(vCurrYear), $(vPrevYear))

Can someone help me to modify the expression in such a way, so that it can be used in the standard format , i.e mentioned above.

Labels (1)
  • Other

1 Reply
Sue_Macaluso
Community Manager
Community Manager

@Pallabi77 Are you using QlikView or Sense?  I would like to move it into the correct product forum. 

Sue Macaluso