Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
crystles
Partner - Creator III
Partner - Creator III

Choose Highest Value Record based on Separate Field Selection

I have a map. In this map I have the United State. When you select a state, it selects a record in the "State_Abbr" field. So if you select Georgia, it selects only "GA" in that field. Once the State is selected, we show metrics for the Customer located in that specific State.

The problem is, a few of the states, about 4 or 5, have multiple Customers per State.

I need to find a way to have the selection of the State, select one of the Customers automatically. Then I can show a list of the other Customers and if the User wants to switch to another Customer, they can select it there.

There are probably a dozen ways to do this, but just wondering how other people have done, and what has worked best or what hasn't worked at all.

Once option I have is to put a clause in ALL the formulas that show the metrics for the state, to show data for the MAX() CustomerID. That way, if the Customer isn't selected, and there is more than one, it will just default to the Customer with the highest CustomerID. BUT I have quiet a few formulas I would have to go through and change (50+) ....

...so maybe some kind of alternate state or something that would have the actual document select a Customer for me when I select a State, instead of having to specify it in the formulas.

Any help or suggestions would be greatly appreciated! Thanks!

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You could use a Field OnAnySelect trigger for State_Abbr to select the max(CustomerID).

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You could use a Field OnAnySelect trigger for State_Abbr to select the max(CustomerID).

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

crystles
Partner - Creator III
Partner - Creator III
Author

That sounds like it's exactly what I need!


I've never set a trigger for a specific field before.Where in the document would I set it?

crystles
Partner - Creator III
Partner - Creator III
Author

I found it. Under the Document Settings>Triggers>Field Event Triggers.

This works perfectly and saves me from having to change every formula in my document to accommodate the small number of states with more than one Customer.

Thank you so much for your help!