Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Max year is this year

In my data is information about the years 2016 and 2017.

I want make a box like this:

But now I said in my script Year is min 2012 and max 2015. But can I make a formale like this

Max year = this year, now 2015.

and 3 lower years in this case: 2012,2013,2014

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Create a List Box

Instead of Field Select Expression in Field

Use below expression

=IF(Year >= Year(Today())-3 and Year <= Year(Today()), Year)

Use Jaar as Title

Go to Presentation Tab

Untick Single Column

Tick Fixed Number of Columns as 4

now Drag the border and make single line instead of 4

View solution in original post

5 Replies
Anonymous
Not applicable
Author

Hi Lieko,

Though your information is not sufficient I am trying to sahre few samples

Let Max_Year=Year(Today())

Let Min_Year=2012; //Hardcoded

Ifyou have date field in your data then you can create you Min & Max year in script itself

Load Min(Year(Date_Field)) As Min_Year,

         Max(Year(Date_Field)) As Max_Year

From Your_Tablename

Group by key fields;

Note:

it would be good if you share your data

alexandros17
Partner - Champion III
Partner - Champion III

My example

MK_QSL
MVP
MVP

Create a List Box

Instead of Field Select Expression in Field

Use below expression

=IF(Year >= Year(Today())-3 and Year <= Year(Today()), Year)

Use Jaar as Title

Go to Presentation Tab

Untick Single Column

Tick Fixed Number of Columns as 4

now Drag the border and make single line instead of 4

ankit777
Specialist
Specialist

Hi,

Are you talking about loading data for current year and last 3 years?

You can write in where condition

year<=year(today) and year >=year(today)-3

Not applicable
Author

Thanks all! But special thanks for Manish Kachhia!