Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
New Contributor III

Expression to get previous month

Hi All, 

I'm bulding a Pivot Table that tells me the monthly Average Elapsed Time of each resource (Workbook). 

I have an option, that displays an arrow pinting up or down depending on an expression. 

I need the expression that tells: 

For each month: If the Average Elapsed Time of the previous month is lower ='fa-arrow-up'

See the picture attached.

 

Thanks.

image.png

4 Replies
Highlighted
New Contributor III

Re: Expression to get previous month

Have you tried the Before() chart function?

 

https://help.qlik.com/en-US/sense/November2019/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/Inter...

 

Expression would be something like:

=if(Avg(Amount) > Before(Avg(Amount)), 'fa-arrow-up', 'fa-arrow-down')

Highlighted
New Contributor III

Re: Expression to get previous month

It doesn't work...

Thanks!!

Highlighted
New Contributor III

Re: Expression to get previous month

Can you share your QVF file?

Highlighted
Contributor

Re: Expression to get previous month

Hello Torraroger.

Try the expression

 

Avg({<Month={'$(=Month-1)'}>}  value)  --> Considering that the months are numerals. If they are not, use month(date).