简体   繁体   English

Tableau:具有条件的 CountD OR Bins 计数

[英]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.我得到了一些数据,其中 3 个列看起来像这样。

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. apl_id列是application id,service_offered列是每一步提供的服务,date列是service_offered提供的日期。

I want to do the following task.我想做以下任务。

I want to count, how many days took to be completed for distinct apl_ids.我想数一数,完成不同的 apl_id 需要多少天。 Example, for apl_id 12, took 2 days since created is in 14/08/2020 and completed at 15/08/2020.例如,对于 apl_id 12,自创建于 2020 年 8 月 14 日并于 2020 年 8 月 15 日完成以来耗时 2 天。 The apl_id 14 took 1 day to be completed, since Created and completed are in the same Date. apl_id 14 需要 1 天才能完成,因为 Created 和 completed 在同一日期。

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.即 Bin 1 显示数字 1,它指的是需要 2 天才能完成的 apl_ids 的计数。

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):假设您可以依赖最小和最大日期,我会使用 LOD(详细程度)go:

In this case, you may want to use FIXED (or INCLUDE, depending on filters), like this:在这种情况下,您可能希望使用 FIXED(或 INCLUDE,取决于过滤器),如下所示:

在此处输入图像描述

Basically, you just need to calculate the date difference (in days) between max and min date for every Apl Id基本上,您只需要计算每个 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):根据评论中的要求,如果您只想显示至少有一个“已完成”行的 Apl ID,我会像求和过滤器一样使用它创建另一个计算字段(至少 1):

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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