Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have a table like that:
country city population
spain a
spain b
spain c
NY d
NY e
NY f
NY g
I have a chart thats shows the population when select a city, and i want another chart to shows the population in the country of the city that i selected, i don´t know how do it, i research with set analist and alternate state but i can´t get a solution,
Also i want to create another table thats shows the top citys by population of a country when i select a city of that country.
sorry for mi english
greetings
May be use a variable here like this
vVar
If(GetSelectedCount(City) > 0, 'City, Country = p(Country),',
If(GetSelectedCount(Country) > 0, 'Country, Continent = p(Continent ),')
And then use this in your set analysis like this
Sum({<$(vVar)>}Measure)
Please note that the syntax editor is not going to like the variable and will show a red wiggly line, but as long as you get the output you are looking to get, don't pay too much attention to the red weggly line in your expression.
i want another chart to shows the population in the country of the city that i selected
Assuming your expression to be Sum(Population), try Sum({<City, Country = p(Country)>} Population)
Also i want to create another table thats shows the top citys by population of a country when i select a city of that country.
Use the same expression as above and sort the cities in the descending order to see the most populated cities
your example does work but i can´t apply to my real data, the population in mi data its not a field only, its calculated by a large expressions thats involves two fields like that
=IF(SUM({ < PEP_CLASES_COSTE='P.CERRADOS'},MES={'$(vL.MesActual)'}>}PEP_INCURRIDOS_HORAS) <> 0
or SUM({ < PEP_CLASES_COSTE={P.CERRADOS'},MES={'$(vL.MesAnterior)'}>}PEP_INCURRIDOS_HORAS) <>0,
NUM(SUM({<PEP_CLASES_COSTE={'P.CERRADOS'},MES={'$(vL.MesActual)'} >}PEP_INCURRIDOS_HORAS)/SUM({ < PEP_CLASES_COSTE={'P.CERRADOS'},MES={'$(vL.MesActual)'}>}PEP_INCURRIDOS_HORAS)
- SUM({<PEP_CLASES_COSTE={'P.CERRADOS'},MES={'$(vL.MesAnterior)'} >}PEP_INCURRIDOS_HORAS)/SUM({ < PEP_CLASES_COSTE={'P.CERRADOS'},MES={'$(vL.MesAnterior)'}>}PEP_INCURRIDOS_HORAS),'###,##%')
)
May be add this set analysis to your expression?
City, Country = p(Country)
that works! so much thanks!, i have another issue, i want to do the same but i have a colum with continent, and 2 tables in the fist table i show stats of the selected one and in te second table i shows stats of the "father of the selected", if anyone select city in the first apears stats of the country and if select a country in the first apears stats of the contienent,
thanks and sorry for mi english.
May be use a variable here like this
vVar
If(GetSelectedCount(City) > 0, 'City, Country = p(Country),',
If(GetSelectedCount(Country) > 0, 'Country, Continent = p(Continent ),')
And then use this in your set analysis like this
Sum({<$(vVar)>}Measure)
Please note that the syntax editor is not going to like the variable and will show a red wiggly line, but as long as you get the output you are looking to get, don't pay too much attention to the red weggly line in your expression.
hey, i do it but in the chart apears the error: "overextended the asigned memory" i try to do it with a simple example and it makes the same error.
Do you mind sharing your simple example with us here?
hi sunny, finally i do it using and expresion like this
IF(GetSelectedCount(ciudad)>0,Sum({<ciudad, pais = p(pais)>} poblacion),
IF(GetSelectedCount(pais)>0,Sum({<pais, continente = p(continente)>} poblacion)))
i have a problem now, in section access i give access only a data of a city , but when a user enters and show the data of her city he want to show top 10 city of her country too, but the data are filtered with the section acces so i can´t do it, any idea? so much thanks for the help!
You can pre-aggregate the data in the script... but essentially that is the only way you might be able to do this