Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all:
I've gone through quite a few forum posts on this, and I'm still not able to make this work as intended. I'm looking to construct a line chart that shows growth rates for multiple zip codes as it relates to a base year, e.g. 2020 is my base year, I want to see the growth rate from 2020 to 2021 and from 2020 to 2022. Per the example I have attached, I have a type, year, zip code, and volume field that I've done in an inline load (for example purposes). My expression for the chart is as follows:
(sum({<Type = {'1'}>} Volume)
/
sum({<Type = {'1'},Year={'2020'}>} Volume)
)-1
The dimensions used in the graph are year and zip code. I've tried creating a separate set of years (i.e. using a separate inline load that just contains the years I want to analyze) to use as the table dimension, using "sum(total" in the numerator or denominator of that division, and other solutions provided previously on the forums, but have had no luck thus far. Ideally, the graph should have a line for each zip code, with percentage on the y-axis and year on the x-axis, with the values of the points as follows, per the data in the example attached:
2021 | 2022 | |
22546 | 20% | 40% |
22547 | 25% | 50% |
Any help would be greatly appreciated.
Thank you very much!
Try this
Sum({<Type = {'1'}>} Volume)/Sum(TOTAL <Zip> {<Type = {'1'},Year={'2020'}>} Volume)-1
Try this
Sum({<Type = {'1'}>} Volume)/Sum(TOTAL <Zip> {<Type = {'1'},Year={'2020'}>} Volume)-1
That worked perfectly, thank you so much!