Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
I want to create a bar graph visualization using Year as a dimension.
Each bar should be calculated as: Current Year (vol) / Prev Year (vol)
I am unable to fetch the Prev Year value.
Could you please explain how can I write an expression which will take the current dimension value and subtract 1 from it to get the Prev year?
Thank you
@User0 Did you test GetFieldSelections :
and use -1 to get previous year for selected value ?
Hi Taoufiq,
It needs to be a static graph, I do not want to change it as per the year selection from the filter.
It should show me the data from the years 2010-2022. No option to choose any year.
Thankyou
Hi you need to write set analysis like following :
Current Year Sales
=Sum({<Year = {'$(=Max(Year))'}>} Sales)
Or
By Formula use
=Sum({<Year = {"$(vCurrYr)"}>} Sales)
Previous Year Sales
=Sum({<Year = {'$(=Max(Year)-1)'}>} Sales)
Or
By Formula Use
=Sum({<Year = {"$(vPrevYr)"}>} Sales)
Hi @vikasmahajan ,
Thank you for your suggestion but it did not work how I wanted it to .
Attaching a demo graph to show , each year should show a bar with the formula as (Current year volume - Prev year volume) and the year is the dimension in the graph .
The two separate bars are for different brands.
By using the above formulas, I am only seeing graph for the current year and previous year(coming up as blank).
Thankyou
Can you please attach some sample data to help you 😉
Brand | Year | Vol |
A | 2021 | 3456 |
A | 2022 | 5434 |
B | 2021 | 5434 |
B | 2022 | 546 |
V | 2021 | 435 |
V | 2022 | 5345 |
K | 2021 | 4234 |
K | 2022 | 435 |
W | 2021 | 54 |
W | 2022 | 654 |
Hi @vikasmahajan , I have multiple brand data yearly. Attaching sample data for you.