Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
devans_1
Creator
Creator

Restricting user access to data by one year

A Happy New Year to everyone. A new year, a new problem....

I would like to display data for a particular year in a chart as well as displaying the data for the equivalent period in the previous year. The year is selected via a list box. I can display the previous year's data using set analysis but the problem I am having is restricting the number of years that the user can select data for.

My script has to pull data for one more 'past' year than I would like the user to see the data for so that I am holding the previous year's data. - e.g: for years 2011 & 2012 I have to extract data for 2010 so that if the user selects 2011, the set analysis has access to the 2010 data. But if I extract data for 2010 the user is then allowed to select this in a list box.

Is there any way I can restrict the user to just see the number of year's I have extracted the data for less one ?

1 Solution

Accepted Solutions
anderslinden
Partner - Contributor III
Partner - Contributor III

Hi!At least in QV11 you can have an expression as listbox dimension, so you could put
=
if(Year>=2011,Year)
as dimension (at the bottom of the fieldlist you will find the possibility to choose expression instead of just an existing field). Not shure from what release this is possible.
Anders
BI Consultant, Business Information Providers
www.bipab.se

View solution in original post

3 Replies
gussfish
Creator II
Creator II

You could add an extra field to your table called, say, SelectableYear.

Populate it so that it is the same as your Year field, except that it

has null for the Year values you don't want the user to see. Then, use

SelectableYear as the basis of your table or selector.

Angus.

anderslinden
Partner - Contributor III
Partner - Contributor III

Hi!At least in QV11 you can have an expression as listbox dimension, so you could put
=
if(Year>=2011,Year)
as dimension (at the bottom of the fieldlist you will find the possibility to choose expression instead of just an existing field). Not shure from what release this is possible.
Anders
BI Consultant, Business Information Providers
www.bipab.se
devans_1
Creator
Creator
Author

Thanks everyone. Both these replies are along the same lines and seem to be the solution. I added a couple of bells and whistles by setting up a variable on opening.

Min Year =min ({1} Year)

I can then refer to this in the list box.

=if (Year = $(Min Year), null (), Year)