This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
We are updating the requirements for Community registration. As of 7/21/21 all users will be required to register a phone number with their My Alteryx accounts. If you have already registered, you will be prompted on your next login to add your phone number.
When data goes into a Table tool, it is built as a single field which means the standard transformation tools will not work. What you might need to do is use the data ahead of time to determine what needs to be highlighted, create some flags for those fields, then use the Table tool to create the final table and use those flags to apply the formatting you desire.
Could you share some screenshots/sample data to give us a better idea of what you'd like to do? I'm sure we could figure something out.
I've put together a quick example that shows how a flag method could work. It identifies rows where a change occurs and adds a flag field to both data streams. Now when those layout fields are created by the Table tools, the flag field can be used to update formatting by changing the row color, but not actually included in the data. This is done by de-selected the "Flag" field and adding a "Row Rule" to change the background color based on the value of that field.
I understand. This is possible, but it gets a bit more complicated. I'll explain the method below and I've got an example attached that shows how it's done.
The first part is the same: transpose the data to identify the vales that should be highlighted. Instead of summarizing this by rows, we could summarize this into a set of Column Rules for every field that specifies which RecordID values from that field to apply the formatting to. For example: the [Marriage Status] field would have a Column Rule that applies when RecordID=1. To update these Column Rules with data from the workflow, we'll have to wrap the Table tool in a batch macro so we can use the Control Parameter to edit the XML of the Table tool.
- To get the rules formatted the way I want, I use a Table tool and apply the formatting in the tool. I then open the XML of that tool and copy the style rule section so I can modify it like you see in the formula below. To view tool XML: enable XML view in your user settings (Options > Edit User Settings > Advanced > Display XML in Properties Window), click on the tool, then click on the "</>" icon on the configuration window.
- Each table style rule gets a UUID assigned to keep things organized inside the Table tool. Luckily the function UuidCreate() is available to call the same process when creating your own rules outside of the Table tool. Here's the formula I used to create each Column Rule:
- The Action tool settings are critically important to apply the XML update correctly. I select the "StyleRules" parent and set "Update Inner XML". Since the "StyleRules" parent is always present, I just need to populate contents within.
Let me know if you have any questions.
EDIT: I added a few tools to make sure everything works in the case where there are no differences between the tables. (Basically just sends an empty rule set)
This is a great solution! Do you know any articles on how to do this sort of thing with the XML? I am trying to do some thing similar. I have a lot of columns each with a corresponding column that designates the conditional formatting. For example, column one "sales" column two "sales_formatting". Is there a way to highlight my cells based on the corresponding column without having to write formulas for each column?