I have a table named test_tb with structure below: ID, Supplier, Trade_name, Price, Date(8 string format such as 20080104,not in data format)
I want to calculate link relative ratio monthly. such as sum(price) of Oct is $100 , and Nov is $80, then the result will be (80-100)/100=-20%
I use expression Sum ({$<year={$(max_year)},month={11}>}price)-Sum ({$<year={$(max_year)},month={10}>}priceSum ({$<year={$(max_year)},month={10}>}price)) for 1 month.
Now I want to calculate 12months' link relative ratio? How can I do this? It's difficult to get Jan's data,because it will campare with Dec. of last year.
Depending on how you have drawed your chart, it can be done using inter-record functions. Say that dimension is Client and Month, and that Month is pivoted to the top, so for each client you see the twelve months of this year. Then, create a new expression with
Sum(price)
And label it as "Monthly". To get what you want, you may use as expression