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: 
qv_testing
Specialist II
Specialist II

Default selection for year

Hi Community,

I am comparing with data last 2 years..

As per my data 2009 and 2010 (whatever last 2 years)

I have selections  See below Selections...

By default i want to show like below image...(2009 and 2010 by default selections for that particular charts )

and third chart i want to show 2009+2010 sum of the data.

If i am select Division, category and ProductName for i want effect 2 charts

Years should be static for these particular charts. whatever last 2 years.

PFA,

Thanks in Advanvce..........

6 Replies
sunny_talwar

PFA attached

Capture.PNG

qv_testing
Specialist II
Specialist II
Author

Hi Sunil,

If i am select Division, category and ProductName not reflecting data in Second chart  and

3rd chart also not effecting (2009+2010).

sunny_talwar

I didn't know you have alternate state. Bring all the objects to inherited state and it should work

sandeep_sarawgi
Partner - Contributor III
Partner - Contributor III

I have recently worked on a requirement like that.  I don't suggest using Alternate State for this.

What you can do is obtain distinct years in script in a separate field YearSelect

Feed that into a list box.

Define a variable vYearSelect to store  if(isnull(GetFieldSelections(YearSelect)), max(YearSelect),GetFieldSelections(YearSelect))

Create a dimension (which you can hide) = if(Year=vYearSelect,Year).  Choose the option to suppress when null. 

Similarly for previous year table you would do

Define a variable vPriorYearSelect to store  if(isnull(GetFieldSelections(YearSelect)), max(YearSelect)-1,GetFieldSelections(YearSelect)-1)

Create a dimension (which you can hide) = if(Year=vPriorYearSelect,Year).  Choose the option to suppress when null. 

Sandeep Sarawgi
qv_testing
Specialist II
Specialist II
Author

Thanks Sunny..

I have doubt, can we show selection in Year list box (2009 and 2010)

sunny_talwar

Here you go

Year listboxes are in alternate state now. rest everything in inherited state

Capture.PNG