4 Replies Latest reply on Nov 18, 2018 1:45 AM by Adil Jamal

    Dual Axis of Two graphs

    Adil Jamal

      Hey Community!

      I'm preparing a dashboard of emission/fuel (you can select any via parameters) consumption of different states of India. And I've applied 'Filter Actions' in that dashboard such that if you select any particular state, all the graphs will change accordingly.

      Dashboard 2.png

      In the above dashboard, the graph below the map, I want it to be on dual axis. One of the graphs showing the energy/emission of a state (Gujarat as shown). The 2nd graph should show the percentage share of that very state in a particular year. (i.e., say, In 2005, Gujarat consumed 15 MTOE of energy, but the sum of all the states come out to be 100. Then the graph should point 15% against 2015 when state 'Gujarat' is selected. Similarly, when no state is selected a straight line of 100% should be seen for the different years.

      I was trying the following calculation

      {Fixed [state] : sum(energy)/total(sum(energy))} but it didn't work.

      Please help.

       

      I've created Parameter as Energy consumed and Emission which is basically the sum of energy consumed (MT) and Emission CO2e respectively.

        • 1. Re: Dual Axis of Two graphs
          Rob Palmer

          Morning,

           

          Attached is a working workbook. I had to make a few changes to get this working as you wanted. The first, was to put the viz side into context. This makes sure that this is taken into account before the data for the viz is calculated:

           

           

          You can do that by right clicking the pill and selecting add to context. The next was to create a variable to calculate the maximum consumption per year:

           

           

          Then I amended your calculation so that it was as follows:

           

           

          This then gives you the behavior you're after

           

          I've had issues so will post the workbook in a bit.

           

          Thanks

          Rob

          1 of 1 people found this helpful
          • 2. Re: Dual Axis of Two graphs
            Rob Palmer

            workbook attached

            • 3. Re: Dual Axis of Two graphs
              Adil Jamal

              Hey Rob!

              When I select a particular state, the calculation works fine. The line graphs show the per cent share of that state wrt all the states. But, since my 'Fuel share' pie-chart on the right middle is also synced (I've applied filters via Actions) with the change in states, I'm getting a diff result than expected.

              That is, say I select Gujarat, and on the fuel share I select 'Coal & Lignite'. The bar graph in the bottom left shows the consumption of 'Coal & Lignite' in 'Gujarat' over the time range, which is correct. But the line graph which is in dual axis with the bar graph shows the per cent share of Coal & Lignite of Gujarat corresponding to the total energy consumption of that year. (But I wanted the per cent share of coal & Lignite of Gujarat over total consumption of 'coal and lignite' across all states for a year, since we're analysing the trend of a particular state's fuel wrt all the states)

               

              For the above description, I've assumed parameter to be 'Energy Consumed'

              Please help!

              • 4. Re: Dual Axis of Two graphs
                Adil Jamal

                Michel Caissie bro could you help me with this. It'd mean a lot.