Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
darren_dixon
Contributor III
Contributor III

Set analysis to find current year, year-1, year-2

Hi,

I'd like to use a straight table with 3 expressions to find the total appointments for each financial year.

To achieve this i was trying to change the code below to =[ActualStart.Fiscal Year]-1

count({$<[ActualStart.Fiscal Year]= {'2011-2012'}>} [Appointments])

PriorityTotal Appointments2011-122012-132013-14
Standard100302050
Emergency2510105
1 Solution

Accepted Solutions
montero91
Creator
Creator

Hi Darren

Try with:

Current Year

count({$<[ActualStart.Fiscal Year]= {$(=Year(Today()))}>} [Appointments])

Year -1

count({$<[ActualStart.Fiscal Year]= {$(=Year(Today())-1)}>} [Appointments])

Year -2

count({$<[ActualStart.Fiscal Year]= {$(=Year(Today())-2)}>} [Appointments])

or if you want the two years anteriors

count({$<[ActualStart.Fiscal Year]= {$(=Year(Today())-1),$(=Year(Today())-2)}>} [Appointments])

Always take the current year of today, but you can use the "max" to be against selected year maximum, if selected 2012 the previous year is 2011.

if you put in the set analysis '2012-2013 ' it is taken as text not like range. is a number the value of ActualStart.Fiscal? or is a Text?

View solution in original post

2 Replies
montero91
Creator
Creator

Hi Darren

Try with:

Current Year

count({$<[ActualStart.Fiscal Year]= {$(=Year(Today()))}>} [Appointments])

Year -1

count({$<[ActualStart.Fiscal Year]= {$(=Year(Today())-1)}>} [Appointments])

Year -2

count({$<[ActualStart.Fiscal Year]= {$(=Year(Today())-2)}>} [Appointments])

or if you want the two years anteriors

count({$<[ActualStart.Fiscal Year]= {$(=Year(Today())-1),$(=Year(Today())-2)}>} [Appointments])

Always take the current year of today, but you can use the "max" to be against selected year maximum, if selected 2012 the previous year is 2011.

if you put in the set analysis '2012-2013 ' it is taken as text not like range. is a number the value of ActualStart.Fiscal? or is a Text?

Not applicable

Hi Darren,

as I understand it, your field ActualStart.Fiscal Year contains the valies '2011-2012', '2012-2013', ... . Qlikview will interpret this as text, which will make it hard to make your year-1 en year-2 work.

I think the best way is to create an extra field which only contains the start year. You can create this field in the existing table, or create an extra table for this purpose.

ActualStart.Fiscal Year   |   ActualStart.FiscalYearStart

2010-2011                      | 2010

2011-2012                      | 2011

2012-2013                      | 2012

You can then use this new field just the way you were trying.