Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Dynamic Range for Shapemap Legend

Hey, 

 

I have a simple enough table, as below (not full table)

Local_AuthorityPolicy TypeCount
Kerry County CouncilPolicy 11
Roscommon County CouncilPolicy 21
Sligo County CouncilPolicy 21
Tipperary County CouncilPolicy 21
Offaly County CouncilPolicy 11
Kerry County CouncilPolicy 2

1

Offaly County CouncilPolicy 11
Sligo County CouncilPolicy 11
Offaly County CouncilPolicy 11
Cork County CouncilPolicy 11
Fingal County CouncilPolicy 11
Tipperary County CouncilPolicy 21
South Dublin County CouncilPolicy 21
Dun Laoghaire-Rathdown County CouncilPolicy 21
South Dublin County CouncilPolicy 21
Fingal County CouncilPolicy 11
Fingal County CouncilPolicy 21
Cork County CouncilPolicy 11
Cork County CouncilPolicy 11
Cork County CouncilPolicy 11
Cork County CouncilPolicy 11
Limerick City and County CouncilPolicy 11
Cork County CouncilPolicy 11
Kildare County CouncilPolicy 21
Mayo County CouncilPolicy 21

 

This table is represented in the shapemap

 

What i would like to see is that when i use the Policy type column to filter the map the legend changes accordingly. So, if i change to policy 1 the location for dublin might change from range 10-20 to 1-10. 

The problem as i see it is the legend only takes a category variable and these categories aren't dynamically calculated based on filter changes. A measure isn't alloweed as the legend data type. 

If this isn't possible i would be open the 'overlaying' another chart on top of the map (say a treemap or something else) that would also show the legend categores changing with the filter. 

As a note: A location may have multiple policy types associated with it. Ex, Dublin may have 3 rows, 2 being Policy 1, the other Policy 2. 

 

Hope it is clear. Any help would be greatly appreciated. 

 

2 Replies

  • v-xiaosun-msft's avatar
    v-xiaosun-msft
    Community Support

    Hi Anonymous ,

     

    Could you please tell me the definition and calculation logic of your "applications range" and the relationship between it and "policy" in order that we can help you further more?

     

    Best Regards,
    Community Support Team _ xiaosun

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hey,

     

    The logic for the range, that i've been trying to use, is a simple Swith()  or nested If statement. Something like,

    Dynamic Legend =
    SWITCH(
        TRUE(),
        Sum(TypeCount) > 30, ">30",
        Sum(TypeCount) > 20 && Sum(TypeCount)<= 30, "20-30",
        Sum(TypeCount) > 10 && Sum(TypeCount) <= 20, "10-20",
        Sum(TypeCount) > 1 && Sum(TypeCount) <= 10, "1-10",
        Sum(TypeCount) < 1, "0"
    )
     
    or the equivalent in an if statement. But this isn't working.