Is it possible to conditionally format the font colour of one column based on the value of another? - tableau-api

I have a workbook which identifies valid and invalid names for certain elements within my dataset.
I want to change the colour of the font in each column to the left of wherever the word Invalid appears to red, and to green wherever Valid is shown.
In the example screenshot I provide, I want the value under Identity Data.Name to be listed in red whenever the value of Val Department reads Invalid department and green whenever it reads Valid department. The same goes for the other columns in the example, too.
(Note that I have narrowed some columns to protect sensitive data, but it doesn't affect the relevance of the image.)

You have to drag the dimension text you want colored into the Label mark. That is the only way to do conditional font color in Tableau, that I know of.

Related

Add a label to a Line graph indicating the name of the variable in Tableau

I have a created in tableau 2 a graph with 2 lines and I need to use Red when value<0.
To make clear what variable (Calculated field attached example screenshot), i would like to add a label on the graph indicating the name of the variable.
I have the same graph for different languages, so this should be shown on all visuals with these 2 lines.
Thanks!!!
You could either show the legend or create a calculated field to only show the name on the last data point, then put that field in the Label shelf alongside the numbers. As your calculated field only returns a value on the last occurence, it'll be null for all other values.
Your calculcation will be something like:
IF LAST()=O THEN [dimension] END

Background Color Not Filling in Entire Row Based off Expression in SSRS

I was hoping I could get some help on this issue. Got a report that displays data for events; of which we have two types: fixed and mobile.
To fill in the row based off what type the event is, I used this expression:
=IIF(Fields!OwnerType.Value = "Fixed", "LightSteelBlue", "#FFFFFF")
But here is what the result actually look like:
The rows with the light blue background color are fixed sites are often not assigned incentives/promotions. And if they aren't, I would still like the entire row to have a background color of light blue.
My issue like in the fact that the incentive columns (Sam's Club, T-Shirts, Wal-Mart, etc) are created dynamically through a column grouping - I have no which values might appear here or how many.
The way I have it configured currently is to put an expression on the cell itself:
But it leaves me with my reason for posting, I can't get the entire row to be back filled with this column grouping.
And if I apply the expression =IIF(Fields!OwnerType.Value = "Fixed", "LightSteelBlue", "#FFFFFF") to the column grouping the same way I did for the row, it will only change the colors of the individual cells where the incentive is and the header.
Under Group Columns -> Incentives Properties, can I change the visibility to also include the background color fill?
Added this expression for the row:
=Iif(
Max(
Iif( Fields!OwnerType.Value = "Fixed", 1, 0 )
, "Row_Group_Name"
) = 0
,"White"
,"LightSteelBlue")
Which filled in the entire row.

How to color code cells of a column based on the text value in Tableau

I'm a new tableau developer trying to develop a table based tableau report. I have a column in the table called "Status" which essentially contains 3 values "In progress" , "Blocked" and "Completed". I want to color code the cells of this column based on these text values. I was unable to get this from the tableau community and hence posting it here. Anyone faced this problem? Kindly let me know how you solved it.
Raghu
First thing, Tableau is not excel. Stop trying to make Tableau work like excel, you'll miss most of the power Tableau brings, and make it inefficiently operate like Excel.
That being said, let me give you an alternative. Instead of text chart (which is what you're using to get a table), select Shape chart. This will add balls in the last column (but you can choose what shape you want)
Now drag the Status to color, and voilĂ , the balls are painted accordingly to Status. You can customize the shapes too (just drag some field to Shape), and selected what shape and color you want to each value.
This will look more like a "control panel", with the color of the balls something like a traffic light. You can even import some pictures of traffic lights and use them as shapes, that could be cool (if properly used)
I know this post is a couple years old, but there is a way to do this. In a new tableau workbook, import the data from Excel (just one column with the status values). Rename the table to "Status Colors" with a dimension field called "Status". Click the dimension field "Status" and select Default Properties > Colors. Assign the colors to each data item (value). For custom colors (RGB, HTML, etc.) double-click the color next to the value and assign the desired color. Click OK, then publish the data source to the server with the options checked to "Include external files".
You now have a Tableau data source that can be added as data to any other workbooks that when linked, the [Status Colors].[Status] can be used as the color key for the field on any graphs. The default colors are stored in the data source. If you update the color workbook, then it will update any other workbooks that use this data source.
Since SO community has thrown it in active threads, let me propose an answer. Though, I completely agree that we shouldn't replicate features of excel in Tableau, yet here is one workaround.
I took a dummy data like this
create a calculated field say status cf with the following calculation
CASE [Status]
WHEN 'In Progress' THEN 'Yellow'
WHEN 'Completed' then 'Green'
WHEN 'Blocked' then 'Red'
END
create two more CFs say 1 and 0 with just 1 and 0 in these as calculations.
Drag dummy and status to rows shelf. sum(0) and sum(1) to columns shelf.
Drag status cf to sum(0). Edit sum(0) in marks card with type as shape (square), and increase its size. edit colors as fixed in calculation.
Drag status to label in sum(1) in marks card. change type to text
Convert both measures in columns shelf as dual axis.
After a little formatting, you'll get a text table like this
You may optionally hide, status col in rows shelf

Field Value Hidden Unless Data Record's Cell Selected

When I view a particular FileMaker Pro layout, the calculated field Invoice Check Grouping shows up as blank when viewed in either list or grid mode. However, while in grid mode, if I click on a particular Invoice Check Grouping cell, the expected value appears.
In the above image, note how only the currently selected Invoice Check Grouping cell's value shows. I would expect all cells in that column to correctly show their values all the time.
How would I get this column's value appearing all the time? (Note: Invoice Check Grouping is a computed/calculated field.)
Thank you,
Ben
There's something wrong with either the formula itself or, perhaps, the field's formatting. E.g. it could be that the calculation type is set to Number, and the field's Number formatting is set not to show the value when zero. If this is not the case, I'd check the field's conditional formatting rules and then the formula itself.

Prevent a text field within a portal from being truncated, filtering portal contents to display in another layout

I am already using Filemaker Pro 10, I have two questions:
I have a text field in a portal, and whenever I am entering values like "B12C45" in it, it works well, but when the string is longer like "BC12F42, B45z87" it doesn't show whole the strings and omits the letters from it. what Can I do?
My second question is that: I have a portal in a layout, in this portal every row has an id sometimes the id is repeated in other rows but the value of another field called Position is changing. Now I want to have those rows of this portal which have the same id in another layout. I have tried using scripts for it, but scripts don't work well in this case, and they are entering whole the portal in the new layout not the parts I want . How can I write a script which does this?
I will really appreciate any help.
For the first question there are many ways you could display more data in a field and the best one will depend on the particular implementation in your database. There are three main ways to solve this problem: field-size adjustments, text-size adjustments and programming adjustments to dynamically change the text-size.
Field-size adjustments include:
Making the field longer
Using the autosizing aspect of a field so that as the window grows, so does the field
Text-size adjustments include:
Making the font size for that field smaller.
Setting the font style for that field to condensed.
Programatically, though, three things stand out to me as possibilities. I like the third one the best for most of my solutions:
Set the tooltip for the field to "Self" (without the quotes). A user can see the entire contents of the field by hovering the mouse over the field.
In "Define Database" set the field's calculated value to: "TextStyleAdd(self;Condense)" (without the quotes) and make certain that "Do not replace existing value of field" is turned off
Use Conditional formatting to add the Condense style or use a smaller font when the number of the characters in the field gets long.
The steps for using conditional formatting are as follows:
In layout mode select the field and select 'Conditional Formatting...' from the pop-up menu
Add a new condition
Change the condition to 'Formula is'
In the text field enter "Length(Self) > 8" (without the quotes)
Press the "More Formatting..." button
Select "Condense" as the Style from the text
You can add multiple conditions, so you might have "Condense" only for Length(Self) > 8 and another condition for Length(Self) > 16 where you set both "Condense" and reduce the Font Size.
As for your second question, I'm not able to get a picture of what you're trying to do from the question you asked. You might be able do the following in a script:
Go to Related Record [the portal relationship]
Sort Records [by ID]
And then use a summary field (Count of ID) to determine how many of each ID you have.
If you clarified what you were trying to do, gave more information about your tables and table occurrences, we might be able to provide a better answer for this instance.