在 Tableau 中创建并排条形图 [英] create side-by-side bar chart in Tableau

查看:226
本文介绍了在 Tableau 中创建并排条形图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个维度,出发"&到达".这两个维度都是 DATETIME 格式.我想显示有离开&的记录数每小时(0 到 23 小时)到达,以并排条形图显示.

I have 2 dimensions, "departure" & "arrival". Both these dimensions are in DATETIME format. I want to display the number of records having departure & arrival for each hour (0 to 23hrs), as side-by-side bar chart.

我尝试了不同的方法来创建可视化效果,但我不知道哪里出错了.我附上了我的 Tableau 文件.

I have tried different ways to create the visualization, but I can't figure out where I am going wrong. I have attached my Tableau file.

表:Wrong_count_for_arrival -->如果我选择,出发"在我的专栏字段中,出发"计数是正确的,但是,到达"计数错了.而且,如果我选择,到达"在我的专栏字段中,到达"count 是正确的,但是,Departure"计数错误.

Sheet: Wrong_count_for_arrival --> If i choose, "Departure" in my Column field, The "departure" count is correct, however, "Arrival" count is wrong. And, if i choose, "Arrival" in my Column field, The "Arrival" count is correct, however, "Departure" count is wrong.

表:double_values -->为了更正以上,如果我把出发"&《到达》在 Columns 字段中,然后我得到了两个departure"的双倍值.&到达"计数.

Sheet: double_values --> To correct above, if i put the "Departure" & "Arrival" in Columns field, then I am getting double values for both "departure" & "arrival" count.

我正在尝试获得类似于Wrong_count_for_arrival"的可视化效果,但计数正确.

I am trying to get visualization similar to "Wrong_count_for_arrival", but with correct count.

附上 Tableau 工作簿.Tableau 工作簿示例数据

Attached is the Tableau workbook. Tableau workbook-sample data

推荐答案

在您的要求中到达和离开是不相关的.
我通过这些简单的步骤实现了您想要的视图-

In your requirement arrival and departures are not related.
I achieved your desired view by doing these simple steps-

  1. 旋转 tableau 本身的数据选项卡中的两个字段
  2. 假设数据透视后的第一个字段是arr 或 dep",这将是一个维度,另一个字段是时间",这将是日期字段.
  3. 使用 datepart('hour', [time]) 添加计算字段,然后从此字段创建大小为 1 的 bin
  4. 您将通过向列添加 hour_bins 和arr 或 dep"、向行添加 sum(记录数)以及向颜色标记添加 arr_or_dep 来获得所需的视图

图片预览

这篇关于在 Tableau 中创建并排条形图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆