Cards, Dashboards, Stories

Cards, Dashboards, Stories

Flex table

Hello!

I need to build a flex table in which some variables should be green when the change indicator is increasing and some other should be red when increasing. Could you please tell me how that is possible? Because now you can reverse the direction of the color for the whole table, not each individual variable.

Thank you in advance for your help.

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In

Best Answer

  • Coach
    Answer ✓

    @Elnaz Good catch! Yes, that setting will change the color direction for all fields. Unfortunately the Flex Table chart is not super flexible. Here is an Ideas Exchange post I'd recommend commenting and upvoting for enhancements to it:

    Make the Flex Table the GOAT chart

    In the meantime, you may be better off using the Table/Mega Table chart type in this instance since you can use the color rules as @ArborRose suggested. If you want to add graphics within the table, here is an article on how you can do that: Site faviconCustomer Support Community

Answers

  • Create calculated fields for each variable to determine the color based on the change. These fields set the conditional colors. You can use the calculated fields to make formatting changes.

    1. CASE WHEN Sales Change > 0 THEN 'green' ELSE 'red' END
    1. CASE WHEN Expenses Change > 0 THEN 'red' ELSE 'green' END

    Add Conditional Formatting:

    Open your Flex Table in the analyzer.
    Click on the column header for the variable you want to format.
    Go to Column Settings > Conditional Formatting.
    Add a new rule for each calculated field you created.
    Set the format based on the values of the calculated fields (e.g., green or red).

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • Member

    @ArborRose Thank you for your reply. I don't think this works, because I don't have the changes in my variables, and the changes are calculated by the flex table directly. So it compares each week with the week before, as I have chosen 'Penultimate value' change for a weekly table.

    So what I want is to change the color of these directions for some variables only(not the color of table cells):

  • @Elnaz If you check the Reverse color direction box under "Change Value Options", that should give you what you're looking for

  • Sample data (sample.csv)

    Month

    Sales Change

    Expenses Change

    Jan

    10

    5

    Feb

    -5

    -10

    Mar

    15

    -8

    Apr

    -3

    12

    Expenses Change Color:

    1. CASE WHEN Expenses Change > 0 THEN 'red' ELSE 'green' END

    Sales Change Color:

    1. CASE WHEN Sales Change > 0 THEN 'green' ELSE 'red' END

    Color rules (under properties):

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • Member
    edited July 2024

    @MichelleH Thanks for your reply! That will reverse the color direction for all the variables at once, however what I need is to have some variables green as they increase and some other red as they increase, in one individual table.

  • Member
    edited July 2024

    @ArborRose Thanks! The problem in your solution is that the color rules that you have put are not working, as you conditioned expenses change > 0 as red, however it is still green for positive change in your flex table.

  • Coach
    Answer ✓

    @Elnaz Good catch! Yes, that setting will change the color direction for all fields. Unfortunately the Flex Table chart is not super flexible. Here is an Ideas Exchange post I'd recommend commenting and upvoting for enhancements to it:

    Make the Flex Table the GOAT chart

    In the meantime, you may be better off using the Table/Mega Table chart type in this instance since you can use the color rules as @ArborRose suggested. If you want to add graphics within the table, here is an article on how you can do that: Site faviconCustomer Support Community

  • @Elnaz - I was responding to your question by showing you an example of how conditional formatting in a flex table may be implemented. I'm trying to assist while I am working my own projects, meetings, etc.

    Hopefully so you can apply the example to your data and needs. As Michelle mentions, your solution may only require flipping the color direction. I don't know details of your data or the specifics of what you need to solve.

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • Member

    Thank you @MichelleH! :) Sure, I will do!

  • Member

    @ArborRose Yeah I totally understand, thanks for your time :) I was just explaining the reason it is not working, so we can find a solution for that.

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In