Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Show % difference between lines in a chart with tooltips

Hello, 

 

I have the following data in a line Chart, it has all months of 2017 and just 9 months in 2018.

 

How can i display the sales difference in percentage between the years by month? 

 

Thank you

 

Year Sales Month

2017581.191
2017545.752
2017534.793
2017493.264
2017522.525
2017529.766
2017568.067
2017516.288
2017531.389
2017525.7210
2017563.4111
2017593.3812
2018556.671
2018517.122
2018603.923
2018580.714
2018592.005
2018592.226
2018617.597
2018623.258
2018645.649

3 Replies

  • CR's avatar
    CR
    Resolver II

    Hi Anonymous

     

    Here are the steps I used to create to get that:

     

    • open your query editor
    • add a merged column to concatenate MONTH_YEAR
    • sort on this column

     

    • add two indexes, one from 0 and one for 1

     

    • use the function Merge queries as follows 

     

    • expand the selection by keeping MONTH and SALES

     

    • add a conditional column SAME MONTH to know if the next line of your current line refers to the same month

    • add a custom column RESULT saying that IF the next line refers to the same month then substract 

     

    Then you get that:

     

    Regards,

    CR