Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select values from dimension with a variable

Gretting, I have a little problem.

I have the dimension year and month. The years are 2009 to 2013, the month are complete. In the relation Year-Month, for the case of 2013, its last month is June (6).

So, I need select the max month for every year when I select the year. In other word, when I select 2009 or 2012, the max month should be 12, and when I select 2013 the max month should be 6.

I create a variable just like that: =If( Year = Max(Year),   Max(Month) )

It works, the default value of the archive is the max year, 2013, and select June (6) , but when I select other year, the month not change to 12. If I erase all the filters, and I select 2012 to 2009, the max month is 12, and when I switch to 2013, the max month changs to 6.

The problem is that, for default the year is 2013, and select its max month, but if the first thing that I made is select other year, the max month for 2013, June (6), remain selected, and I need the month change every time that I select a year.

I put a trigger in the dimension 'Year', that take the value for the variable, that's the way that I made.

Any suggestion?, I hope to find a solution.

Thanks.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

creat a variable and use it as a trigger  vmax = max(year)

And  create a variable just like that: =If( Year = ' $(vmax) ',  Max(Month) )

hope it helps

Thanks

View solution in original post

7 Replies
Not applicable
Author

No one can help me?, or Didn't I explain it correctly? 😕

Anonymous
Not applicable
Author

Can you post a sample application ? It is hard to understand what you mean.

Jonathan

Not applicable
Author

I want to see this:

I select one year, and immediately the report select the last month of that year.

On the case of this year, it's June. A sequence of that I want:

Select 2013 ----------------> Report select June

Select 2011 ----------------> Report select Decembrer

Select 2009 ----------------> Report select Decembrer

Select 2013 again -------> Report select June

Select 2009 again -------> Report select December

Select 2013 again -------> Report select June

Thanks.

Anonymous
Not applicable
Author

creat a variable and use it as a trigger  vmax = max(year)

And  create a variable just like that: =If( Year = ' $(vmax) ',  Max(Month) )

hope it helps

Thanks

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I think you need something like this:

=Max({<Year = {"$(=Max(Year))"}, Month = >} Month)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

It's work perfectly, thanks.

Do you can me explain why use vmax with the sign '$' and the single quotes?.

Thanks you, regards.

Not applicable
Author

Works, but when I use like a trigger on the dimension Year, don't work again. Still remain "June" perhaps I change the year 😕