I want to conditionally show the text in a cell when two columns in the same table differ. How would I go about writing the conditional statement?
Hi Robin,
Personally, I think that's not possible currently to directly compare two-column values with the built-in "equals" operator.
But what could be an idea for you to try out, depending on where the data in your table is originating from, is the following:
- If your data is coming from an ad hoc data source anyway, you can elaborate that C# code to add an extra column that is doing the .Equals() in C# and adding an extra column with a boolean value. You can than put the condition on that boolean value.
- Another more generic workaround, that could maybe work on every table, but looks a bit hacky, is to combine the power of the two possible column manipulations .
Step 1: Concatenate the two column values in a new third column, with for example a '-' in between.
Step 2: Use a Regexmatch to check if that new third column consists of two equal values with this pattern: ^(?<first>.+) (?<first>\k<first>)$ .
Step 3: Use the result of this RegexMatch for your condition and show the text you want.
Kind regards,
Joachim
Ah yes, that seems to be the most user-friendly. I did not know you could use this with multiple input columns, I thought it was specifically for one.
But apparently, you can have two columns (example: https://docs.dataminer.services/user-guide/Advanced_Modules/Dashboards_and_Low_Code_Apps/GQI/Extensions/Custom_Operator/Tutorials/Creating_Minus_Operator.html) and then this is indeed better.
Isn’t the best solution for this a custom GQI operator? https://docs.dataminer.services/user-guide/Advanced_Modules/Dashboards_and_Low_Code_Apps/GQI/Extensions/GQI_Custom_Operator.html