Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Required to put the years in a list box

Hi, I have a situation where the years are not in 'continuity'. For example, in the input data: '1-Jan-1994', '31-Jul-1996', '14-Sep-1999'...etc. It shows that data for a few years are missing.

I need to create a listbox which spans from minimum year to the maximum with all those years that falls in between...for example, I need the output in the list box as: 1994..1995..1996...1997...1998...1999  (though there is no data for 1995, 1997 and 1998)

I have taken min and max of the year in the expression section of the list box...but I am not able to proceed further.

Thank you.


Tags (1)
1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: Required to put the years in a list box

here for master calendar

http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/16/the-master-calendar

or,  just a small example

SET vMinDate = makedate(1994);

SET vMaxDate = makedate(1999,12,31);

calendar:

load

  date($(vMinDate) + rowno() -1) as d,

  month($(vMinDate) + rowno() -1) as m,

  year($(vMinDate) + rowno() -1) as y

AutoGenerate

  $(vMaxDate) - $(vMinDate) +1;

View solution in original post

3 Replies
Highlighted
Specialist
Specialist

Re: Required to put the years in a list box

If you have Master Calendar in your data model,the years will be listed properly

Highlighted
MVP
MVP

Re: Required to put the years in a list box

here for master calendar

http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/16/the-master-calendar

or,  just a small example

SET vMinDate = makedate(1994);

SET vMaxDate = makedate(1999,12,31);

calendar:

load

  date($(vMinDate) + rowno() -1) as d,

  month($(vMinDate) + rowno() -1) as m,

  year($(vMinDate) + rowno() -1) as y

AutoGenerate

  $(vMaxDate) - $(vMinDate) +1;

View solution in original post

Highlighted
Not applicable

Re: Required to put the years in a list box

Thank you!