Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
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.

Tags (2)
1 Solution

Accepted Solutions
Highlighted
srikanthsri1
Valued Contributor

Re: Select values from dimension with a variable

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
Highlighted
Not applicable

Re: Select values from dimension with a variable

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

Highlighted
jonbrough
Valued Contributor

Re: Select values from dimension with a variable

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

Jonathan

Highlighted
Not applicable

Re: Select values from dimension with a variable

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.

Highlighted
srikanthsri1
Valued Contributor

Re: Select values from dimension with a variable

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

Highlighted
MVP
MVP

Re: Select values from dimension with a variable

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
Highlighted
Not applicable

Re: Select values from dimension with a variable

It's work perfectly, thanks.

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

Thanks you, regards.

Highlighted
Not applicable

Re: Select values from dimension with a variable

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