Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

How to create Conditional Formatting rules with multiple AND/OR conditons

Accepted answer
37
Views
3
Comments

We have a use case to compare 2 measures ($ and %) using the AND condition i.e. both conditions must be met. Is that doable?

Best Answers

  • Gianni Ceresa
    edited Dec 17, 2024 9:48AM Answer ✓

    Hi,

    Yes, it's possible.

    From the tags you added to your question I assume you are working in a DV workbook.

    There inside the condition for the formatting is "simple" (not a composed one like you need with RULE_1 AND RULE_2). The quick solution for that is to create a calculation.

    Something simple with a CASE WHEN <RULE_1> AND <RULE_2> THEN 1 WHEN <RULE_3> AND <RULE_4> THEN 2 … END

    Then in the conditional formatting definition you reference your calculation and use condition based on the value you manually set in the THEN (1 in the above quick example).

    Using a calculation with a CASE WHEN returning various flags allows you to easily build complex conditions, using multiple rules instead of a single one.

  • I can only agree with you …

    In "classic" the language (the XML) already accepted complex expressions 10 years ago, but the GUI never allowed to generate them.

    I imagine there are good chances the same applies to DV workbooks, but you also can't tell your users to edit the JSON of the workbook to write expressions manually sadly.

    Maybe worth checking if there is an idea already posted to make the GUI evolve to support composed conditions for formatting, and upvote it (or create one if not there already: if you do, post the link back here, to get some more upvotes).

Answers

  • Jayko Paten
    Jayko Paten Rank 4 - Community Specialist

    Thanks Gianni - I've had to do that in the past, was hoping our users could do this through conditional formatting functionality and not having to create complex calc columns.