Question

Reorder Calculated Fields in Line Graphs

  • 16 February 2021
  • 5 replies
  • 35 views

Hi, I have a visualization here based on a few calculated fields. The blue and red are repeated for each pivot, and the green line is the trailing 12 months average (mean(pivot_row(field))), so it aggregates a subset of the rest. Ideally, I’d love to see the green at the front of the visualization, as it’s the only one that would get called out specifically, but it’s hidden for the most part. I can’t shift the aggregated calculated field over to the left of other fields- is there another way to bring green to the front? Thanks!

 

 


5 replies

Userlevel 6
Badge

Looks like soundwaves :D  I think the problem is that Table Calculations are plotted at the end, hence it gets sent to the back. There doesn’t seem to be a way to bring it to the front.

Hi @brandon ,

 

As a workaround, you could add in some table calculations that exactly match the measures that you’ve already brought in, and then hide the original measures from your visualisation. Then you can move your trailing 12 month average table calculation to come before the new table calculations, e.g.,

 

Please let me know if you have any questions.

 

Best wishes,

Shaan

Hi @shaandalwadi , thanks for the suggestion! I totally see where you’re going with bringing the measures over to the right by replicating them as calculations. What I’m struggling with is that my calculations are pivoted for each line here, then the green ttm line is an average of all columns in each row. So the ttm is stuck on the far right whereas the other calculations are distributed between each pivot. Let me know if I can explain that further. 

It would be awesome if there was just a ‘graphical series order’ option in the edit section where you could bring each field forward or back in line and area graphs. 

Hi @brandon,

I see - that makes sense. Unfortunately as Dawid says, there isn’t a way to bring table calculations ahead of measures in the plotting order. The two ways around it would be to either (1) rewrite the measures as table calculations which, as you pointed out, does not seem possible here, or (2) to rewrite the table calculation as a measure. (2) may be possible by writing it as a subquery in the sql parameter (example of this in the screenshot below) so it may be worth exploring that to see if it’s possible.

 

Sorry I couldn’t be more help here!

 

Best wishes,

Shaan

Userlevel 6
Badge

Just be mindful that this query would be execute per row basis but with some caching and partitioning on status, you could avoid problems

Reply