简体   繁体   中英

Tableau: Count of CountD OR Bins with condition

I have the following problem.

I got some data, where 3 of my columns look like this.

Data Source

The column apl_id refers to application id, the column service_offered refers to the service offered in each step, and the date column refers to the date where the service_offered offered.

I want to do the following task.

I want to count, how many days took to be completed for distinct apl_ids. Example, for apl_id 12, took 2 days since created is in 14/08/2020 and completed at 15/08/2020. The apl_id 14 took 1 day to be completed, since Created and completed are in the same Date.

I was thinking that i may need something like bins, where each bin refers to count. Ie Bin 1 shows the number 1 which refers to the count of apl_ids that took 2 days to be completed.

It's not strictly to do it with bins, but i though that it was the best idea.Any idea will be appreciated!

Which is the better way to do this?

Thank you in advance!

Assuming that you can rely on min and max dates, I would go with LOD (level of detail):

In this case, you may want to use FIXED (or INCLUDE, depending on filters), like this:

在此处输入图像描述

Basically, you just need to calculate the date difference (in days) between max and min date for every Apl Id

EDIT

As requested in the comments, if you want to show just the Apl ID having at least one 'Completed' row, I would create another calculated field using it like a sum filter (at least 1):

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM