0
votes

I have a table in tableau with such columns:

sender_id - id of sender, not unique in the table

date = date of sending.

For example:

sender_id | date
------------------
11111     | 01.01.2020
11111     | 02.02.2020
22222     | 03.01.2020
33333     | 05.01.2020
44444     | 03.02.2020

I need to create a calculated field, which will determine whether this sender_id made a sending after 01.02. It should look like this:

sender_id | date       | calculated_field
----------------------------------------
11111     | 01.01.2020 | 1
11111     | 02.02.2020 | 1
22222     | 02.01.2020 | null
33333     | 02.01.2020 | null
44444     | 03.02.2020 | 1

How could I do this?

1

1 Answers

0
votes

If the first value of sender_id actually should be null (i.e: that the date is in focus to know), then this formula will give you correct:

Calc1

IF date > DATE("2020-02-01") THEN 1 END

If you want to know per sender_id (looking at all the dates and then determine the latest date) then this should give you correct:

Calc2

IF { FIXED [sender_id]:MAX([date])} > DATE("2020-02-01") THEN 1 END

enter image description here