Skip to main content

I have a sheet with 1. Dates, 2. Net Yield Hour 36, 3. Net Yield Day 7, 4. Net Yield Day 14.

 

I want to change the color of each Net Yields columns based on the Date range passed.

 

I have created multiple Calculated Field such as

IF DATEDIFF('day',[Start Date],today()) >= 7  THEN ">=7 Days"

ELSE "<7 Days"

END

 

CASE   [Net Yield Day 7 Formatted] WHEN    [7 Days Passed] ='>=7Days '

THEN    1.00

ELSE    0.00

END

 

but when I combine that Calculated Field to my Column if Net Yield Day 7 -- I get the error "expected type float found boolean"

4 respuestas
  1. 22 may 2019, 19:03

    If you just need a true/false on day 7 then just a calculated field with your first condition:

     

    DATEDIFF('day',[Start Date],today()) >= 7

     

    That will return a true or false. You can drag that to color, but Tableau will only let you color one column without a little trickery. If you want to color columns independently like in your sheet, you'll need to force Tableau to create multiple marks cards, by using a placeholder technique. This video explains the process fairly well. It's not too complex and will open up a lot more options for you

     

    Tableau: Advanced Conditional Formatting - YouTube