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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Pass Previous Year Variable to Expression

I am trying to compare this month to same month last year with a rolling 12 month period for

'Average Daily Contracts Received for Processing per month'

Here is my expression for current year. It aggregates the daily averages for the timespan selected, which is usually fiscal year to date:

=Avg(Aggr($(eNewInBusUnit),Month, Date))

What would be the expression to get previous year's data?

4 Replies
dplr-rn
Partner - Master III
Partner - Master III

put something like below in your set analysis

Year={'$(=Year(Max(DATE))-1)'}

Anonymous
Not applicable
Author

I'm assuming you mean like this in replacement of 'Month, Date'? However, I am getting the infamous red line under the 1st bracket. Do you know the exact syntax in conjunction with the expression given?

=(Avg(Aggr(($(eNewInBusUnit)),Year={'$(=Year(Max(DATE))-1)'

dplr-rn
Partner - Master III
Partner - Master III

No. I mean repeat same logic as current year with the new set analysis

Let me put it this way whats the expression within eNewInBusUnit

Anonymous
Not applicable
Author

eNewInBusUnit=count({<DateType={'SLAQueueStart'}>}BusinessUnit)