Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have data similar to
| City | Popuation | Rank |
| NY | 500 | 1 |
| SJ | 200 | 4 |
| SFO | 300 | 3 |
| LA | 400 | 2 |
The user must select one of the city. I want the accumulated sum (in a text Box)for all the city where exist a same and higher rank.
For example, If the user select SFO, In the text box the final answer should be 1200(NY:500+ LA:400+SFO:300).
Thanks
Try below expression
=
sum({<City=,Rank={"<=$(=max(Rank))"}>}Population)
hi
try it
=rangesum(above(sum(population), 0 , RowNo()))
hope this helps you
Put this expression in a text box if Rank is a field:
=sum({<City=,Rank={">=$(=only(Rank))"} >} Popuation)
If Rank is an expression based on Popuation then you could use:
=sum({<City=,Popuation={">=$(=only(Popuation))"} >} Popuation)
If Popuation should be Population change the expressions accordingly.
hi Gysbert Wassenaa sir
display correct output.
thanks
Hi Gysbert,
Thank you very much for your kind reply.
It is working fine, for a single line of data. But if there is case, where
| City | Popuation |
| NY | 500 |
| SJ | 200 |
| SFO | 300 |
| LA | 400 |
| SFO | 100 |
Could you update the formula you have given earlier.
Which value of the two should be used?
max?
=sum({<City=,Popuation={">=$(=max(Popuation))"} >} Popuation)
min?
=sum({<City=,Popuation={">=$(=min(Popuation))"} >} Popuation)
average?
=sum({<City=,Popuation={">=$(=avg(Popuation))"} >} Popuation)
sum?
=sum({<City=,Popuation={">=$(=sum(Popuation))"} >} Popuation)
Thank you so much for your quick reply.
There must be at least one selection. For example,We need to select SFO.
We need to find the sum of the population for SFO. Then we can give compare the SFO population with other cities population.
It shoud be similar to the last one you indicated "
sum?
=sum({<City=,Popuation={">=$(=sum(Popuation))"} >} Popuation)"
Currently, It is not working, as disired.
Thanks