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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
jayaseelan
Creator III
Creator III

Issue in finding previous year in kpi

Hi everyone,

         I have following fiscal years 2013,2014,2015,2016, i am trying to show the max of fiscal year in KPI its working fine.

and i am trying to  show previous year to the max in KPI is not working. my output screen shot is below.Capture.PNG 

10 Replies
robert_mika
Master III
Master III

Max(FiscalYear)-1 is enough

rubenmarin

Hi, Max(FiscalYear)-1 will return the previous year. You don't need the Year() funtion, as this function expects a date to return the year of the date.

jayaseelan
Creator III
Creator III
Author

Thanks for replying,

                I already used max(FiscalYear)-1. i am getting below output.Capture.PNG

Not applicable

There is some issue with you data.

Max(FiscalYear)-1 do work

Year.PNG

jonathandienst
Partner - Champion III
Partner - Champion III

Then your field FiscalYear is not a year, it is a date field.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

I would prefer to understand why have a field called xxxYear, which contains a date rather than a year value, but you can work around that with

     =Max(Year(FiscalYear)) - 1

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
m_woolf
Master II
Master II

Your expression is working correctly. You just need to adjust the formatting.

jonathandienst
Partner - Champion III
Partner - Champion III

m w wrote:

Your expression is working correctly. You just need to adjust the formatting.

Which one?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jayaseelan
Creator III
Creator III
Author

Thanks Jonathan,

Its working. i changed the format to previous year.  but i have an doubt,

While finding max of Fiscal year there is no problem in format, why issue in previousyear??