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

Alternate States - Current Year vs Prior Year

Hello,

I have 2 Alternate States "A" and "B". Each Alternate State has it's own calendar, Year, Quarter and Month.

I'd like to create a button with an action, that takes the current Year, Quarter and Month selected in Alternate State "A",  and subtracts One Year then applies this selection onto Alternate State "B".

For example.

1. Someone is viewing Alternate State "A" the year selected is "2009"

2. They click the Year over Year button

3. Then "2008" will automaticly be selected in Alternate State "B" along with the corresponding Quarter and Month in the Alternate State "A"

I tried doing this:

Created a button with a "Select in Field" action

Field = Year

Search String = " B::Year = {$(=Max(A::Year)-1)} "

Any Suggestions?

Thank you,

Ben

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Ben,

please check that you've selected the state already in the action tab (where you added the actions to the button).

Then an appropriate selection - select in field action could maybe look like

Field

Year

(no equal sign etc., just the field name)

Search String:

=max({<Year=$::Year>} Year)-1

Please find attached a small example,

Stefan

View solution in original post

4 Replies
swuehl
MVP
MVP

Ben,

please check that you've selected the state already in the action tab (where you added the actions to the button).

Then an appropriate selection - select in field action could maybe look like

Field

Year

(no equal sign etc., just the field name)

Search String:

=max({<Year=$::Year>} Year)-1

Please find attached a small example,

Stefan

Not applicable
Author

Thank you so much swuehl, you're awesome!

I have one more question, about making the user have less clicks when selecting between years.

As of now the user must follow this process:


1. Select a Year

2. Click the Year over Year button.

3. Select a different Year

4. Click the Year over Year button again.

Is there a way to make the Year over Year button a lever or a selection? this way the user can:

1. Turn the Year over Year button or selection ON

2. Select a Year.

3. Select a different Year.

It would be great if the user does not have to click the Year over Year after each different Year they select.

swuehl
MVP
MVP

Ben,

could create a button that just toggles a variable. And then use field event triggers in settings->document properties on field Year to trigger similar actions like above, but check for the variable state before acting.

See attached.

Not applicable
Author

HI swuehl,

I was looking at amending the field even trigger so that a field will match it's selections to another state (or across all states if possible).

Is this possible? I have tried a field event trigger which works out to be =concat({[Question1]} DISTINCT WaveLabel)  and set the state of this event to Question2

I want the WaveLabel field in Question2 to match the WaveLabel field in Question1. The above works if ONE selection is made, but not if multiple selections are made.

Thanks for any help!

CG