Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Nagaraju_KCS
Specialist III
Specialist III

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..........

Labels (1)
6 Replies
sunny_talwar
MVP
MVP

PFA attached

Capture.PNG

Nagaraju_KCS
Specialist III
Specialist III
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
MVP
MVP

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
Nagaraju_KCS
Specialist III
Specialist III
Author

Thanks Sunny..

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

sunny_talwar
MVP
MVP

Here you go

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

Capture.PNG