Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I have a field (State) that appears in another one (City). It's something like:
State City
NY New York/NY
NY Albany/NY
CA Los Angeles/CA
The last 2 digits of the city are always the state, so i can retrieve it by using =right(GetFieldSelections(City),2)
I have a graph that show the sum of the accidents that occured in the selected State. However, if I only select a City in the filter pane, I want the graph for the State to show all the accidents from the selected State (from all the cities in the same State as the selected city). I'm trying to filter the sum by doing something like
sum({<State = {right(GetFieldSelections(City),2)} >}[Accidents])
but can't get the set analysis to work. Any ideas?
try below for your State chart
sum({<State = p(State), City=>}[Accidents])
Hi @MatiasJR , check this
The element set can also be based on the set functions P() (possible values) and E() (excluded values).
For example, if you want to select countries where the product Cap has been sold, you can use:
<Country = P({1<Product={Cap}>} Country)>
Similarly, if you want to pick out the countries where the product Cap has not been sold, you can use:
<Country = E({1<Product={Cap}>} Country)>
try below for your State chart
sum({<State = p(State), City=>}[Accidents])
Hey Vini, one quick question
What does the 'City =' means? What you're setting it equal to?
And the comma is the same as the asterisk, meaning interseccion of the conditions?
like shoul this have the same output
sum({<State = p(State)> * <City = >}[Accidents])
When you want to ignore selections made in a particular field you would use
fieldToIgnore=
This will ignore all selections in that field
<State = p(State)> * <City = >this means
One set where state is all possible states
Intersection with
One Set where city selection is ignored
Think of a Venn diagram when working with multiple sets
Read more on set analysis below
Got it! Thaks for the help, it worked perfectly.