Display state selected

Options

Hi,

I have a map card which has the values populated for all states. I would like to display the selected state name in a text box. However, I noticed, when no state is selected, the text box displays the state name which is in the first row of the data which is misleading. It should either be blank or print some message. How to fix this?

Best Answer

  • GrantSmith
    GrantSmith Coach
    Answer ✓
    Options

    You could use a beast mode to display the selected state if only one is selected:

    CASE WHEN COUNT(DISTINCT `State`) = 1 THEN MAX(`State`) ELSE '' END
    

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**

Answers

  • GrantSmith
    GrantSmith Coach
    Answer ✓
    Options

    You could use a beast mode to display the selected state if only one is selected:

    CASE WHEN COUNT(DISTINCT `State`) = 1 THEN MAX(`State`) ELSE '' END
    

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**