5 Replies Latest reply on Sep 9, 2016 10:37 AM by Mark Mooney

# Date Calculation - Condtition Response (Yes/No) To Date Range

Hi,

I'm relatively new to Tableau and I am trying to define a "Yes/No" response to a condition where a data field, a completion date is used to meet a standard. For reference, any condition date prior to today's day will provide a Yes or No response.

Any help would be appreciated.

Thanks

• ###### 1. Re: Date Calculation - Condtition Response (Yes/No) To Date Range

Hey Mark,

What kind of conditions are you looking for?

You should be able to build out a KPI in a calculated field to determine whether the day is a "yes" or "no".

Something like this:

IF SUM([Sales]) > 1000 THEN 'Yes' ELSE 'No' END

• ###### 2. Re: Date Calculation - Condtition Response (Yes/No) To Date Range

Derrick,

Thanks for the input. I'm using a "date" as a trigger point to set a "No" response for any day prior to today's date.

• ###### 3. Re: Date Calculation - Condtition Response (Yes/No) To Date Range

IF [Date] < TODAY() THEN 'No' ELSE 'Yes' END

• ###### 4. Re: Date Calculation - Condtition Response (Yes/No) To Date Range

For binary calculations (yes / no , true / false) there is a better way to calculate that (less computation for Tableau);

Calc Field Name: Date Trigger

Calculation: [Date] < TODAY()

This will auto set the field to a True/False data type. True when the date is less than today, false for when the date is equal to or greater than.

• ###### 5. Re: Date Calculation - Condtition Response (Yes/No) To Date Range

Jason,

Thanks, it worked like a charm! I was working at it with a machete approach and your "scalpel" fix is simple and easy.

Thanks,