Flex table

Options

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.

Best Answer

Answers

  • ArborRose
    Options

    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.

    CASE WHEN Sales Change > 0 THEN 'green' ELSE 'red' END
    
    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! **

  • Elnaz
    Elnaz Member
    Options

    @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):

  • MichelleH
    Options

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

  • ArborRose
    Options

    Sample data (sample.csv)

    Month

    Sales Change

    Expenses Change

    Jan

    10

    5

    Feb

    -5

    -10

    Mar

    15

    -8

    Apr

    -3

    12

    Expenses Change Color:

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

    Sales Change Color:

    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! **

  • Elnaz
    Elnaz Member
    edited July 9
    Options

    @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.

  • Elnaz
    Elnaz Member
    edited July 9
    Options

    @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.

  • MichelleH
    MichelleH Coach
    Answer ✓
    Options

    @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:

    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: https://domo-support.domo.com/s/article/360043430033?language=en_US

  • ArborRose
    Options

    @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! **

  • Elnaz
    Elnaz Member
    Options

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

  • Elnaz
    Elnaz Member
    Options

    @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.