Up Arrow or Down Arrow for KPIs

Use this case statement to add up and down arrows to your metrics, for instance:

 

 

case
   when [value_field] < lag([value_field]) over(order by [order_field])
     then '▲ '
   when [value_field] = lag([value_field]) over(order by [order_field])
     then 'no change'
   else '▼ '
 end || [value_field] as [value_field]
2replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • This is fantastic -- stakeholders very happy with the visualisations here! 
    An e.g. below. 

     

    The code I used looks a little intimidating at first glance, but it's worked perfectly for desired purpose. 

    Note: Conditional formatting needs to include the ▼  sign to work. 

     

    Reply Like 1
  • To add to this, you can also break out the up-down arrows into a separate per metric column. Maybe you find conditional formatting the entire background of the cell a bit aggressive visually. 

    You can use the character ⇅ (maybe if you use it multiple times just number them like "⇅.1, ⇅.2,..." etc,

    Using the query above, you can then have the metric text colored / not colored, and then have a separate column which shows the up-down arrow only colored, thus reducing the amount of visual noise. 

    Additionally, I would recommend going into this column and setting the width to 1 for the column, so it takes up minimal width in your tables. 

    Reply Like 1
Like6 Follow
  • 6 Likes
  • 2 mths agoLast active
  • 2Replies
  • 615Views
  • 4 Following