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

Selected value of a list box YTD comparison

A YTD Comparison question.. Currently I'm loading our fiscal dates and fiscal year into a table. The fiscal year is located in a list box that allows the end user to select the fiscal year they wish to view. The pivot table has a 2008 column and 2009 column respectively. However, this is a static method where I load code into a 2008 field if it is a specific date range.

What I want to do is make it dynamic. If a user uses the list box and selects fiscal year 2009 I want to automatically know that the previous year is [Current year selected in list box] - 1.

Not sure how to go about this or pulling the (current selected value) from a list box.


Any thoughts or pointers in the right direction would be much appreciated.

Thanks,

Anthony

11 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Your screen shot shows that 2009 is selected for "Year" as well. That means that there is no data selected for 2008. If you are also going to have Year selected, you'll have to use Set Analysis or the ALL keyword to be able to access the unselected year data. For example.

if(match(Selected_year - Year, 1), sum( ALL [Invoiced] ))

If you are going this route, you may find that you don't need the SelectedYear field and can just use Year.

-Rob

Not applicable
Author

Normal 0

Rob, Thanks for all your replies.

This works. However, what if nothing is selected? I have three "select_year" 2007 2008 and 2009 which also means I have three years. How can I add the if statement that says "

if(match(Selected_year - Year, 1), sum( ALL [Invoiced] )) else, sum where year = today() etc.

So it displays the current year previous year and previous year -2.

Thanks,