Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Apply Multiple Style Rules in a Table on a Single Field

BPA1982
6 - Meteoroid

Hi all,

 

In a table, is it possible to put more than one style rule on a particular field?

 

In the below example, I have a particular value, with three pipes (|||) in front of it. Any value with this prefix is to be output in the table as a red colour (as below).

 

Table#2.PNG

 

I did this using a formula:

 

LEFT ([Comments],3) = ‘|||’  and then selecting the colour red. 

 

Rule#1.PNG

 

However, I need to then remove the pipes from the beginning of the string so that only the string and the red colour remain (without the three pipes at the beginning).

 

I’ve tried adding a second rule for the column, using TrimLeft, If statements, etc, and have tried writing something similar into the first rule, however nothing seems to work at all. 

 

So, is it possible to perform more than one rule on the same column within the table tool, so that once Alteryx changes the colour of '|||' prefixed strings to red, it then removes that prefix of '|||'?

 

Any help at all, would be greatly appreciated.

Many thanks

 

Ben

4 REPLIES 4
DanM
Alteryx Community Team
Alteryx Community Team

@BPA1982 you won't be able to change the data within the Table tool as it only creates reporting elements. The functions you use in the tool are only there for you to be able to make visual changes to the table. My suggestion would be to use a different field to designate your data that has the 3 pipes or parse the pipes out into a different field and use that field as a designation and use a Formula to say if this field has 3 pipes, then color this field.

 

I attached a sample workflow that uses two functions in the Formula tool. One to parse out the pipes to a new field and one to remove the pipes from the original field. Then in the Table tool, I added an expression that just states, if the new field contains -1 (which marks if the field contains pipes) then color the other field red.

BPA1982
6 - Meteoroid

Hi @DanM,

 

Thank you very much for your reply and the attached workflow. I tried the formula first before the table tool and that seems to do the trick. I was just wondering however, is it possible to do a regex_match so that an entire string would be returned (e.g. "|||The quick brown fox") as opposed to just a single word?

 

Many thanks

B

DanM
Alteryx Community Team
Alteryx Community Team

@BPA1982 you can do that, but if your data within that field does not match the REGEX match you will end up with nulls where you don't want them. I simplified the workflow so you don't have to deal with that. see attached.

BPA1982
6 - Meteoroid

That's great @DanM. 

Thank you very much for your help in pointing me in the right direction. It's very much appreciated. 

 

Kind regards, 

B

Labels
Top Solution Authors