简体   繁体   English

Tableau - 满足 IF 条件的多个记录

[英]Tableau - multiple records that meet IF condition

I would like to multiple values that meet criteria in tableau.我想要多个符合画面标准的值。

For example:例如:

if [order status] = cancelled and [dtime] = express then 39 
else other end (so it counts number of records *39) 

What I need is to not count the number of records but all unique order_id 's so I used:我需要的是不计算记录的数量,而是所有唯一的order_id ,所以我使用了:

if [order status] = cancelled and [dtime] = express then (countd[order id] * 39)

but this does not work.但这不起作用。

scenario: COUNTD(If场景:COUNTD(如果

[Expedition Type] = "ZEX" and [count bigboxy aj smallboxy] = "BIGBOX" and [Transporter] = "Mall Box" then [Order Id] * 260.6 [Expedition Type] = "ZEX" and [count bigboxy aj smallboxy] = "BIGBOX" and [Transporter] = "Mall Box" 然后 [Order Id] * 260.6

 ELSEIF  ([Expedition Type] = "ZEX" and [count bigboxy aj smallboxy] = "BIGBOX" and [Transporter]= "Mall Pick-Up") then [Order Id] * 260.7
 ELSEIF  ([Expedition Type] = "ZEX" and [count bigboxy aj smallboxy] = "BIGBOX" and [Transporter] = "Ulozenka") then  [Order Id] * 260.6
 ELSEIF  ([Expedition Type] = "ZEX" and [count bigboxy aj smallboxy] = "BIGBOX" and [Transporter] = "--empty--" or [Transporter] = "Cash and Carry" or [Transporter] = "Česká pošta"
  or [Transporter] = "DPD" or [Transporter] = "Helicar" or [Transporter] = "Mall doprava" or [Transporter] = "PPL CZ" or [Transporter] = "Speedy Kuryr" or [Transporter] = "TopTrans CZ" or [Transporter] = "WE|DO" 
  or [Transporter] = "Gebrüder Weiss") then [Order Id] * 260.6 END)

在此处输入图像描述

COUNTD(if [order status] = cancelled and [dtime] = express then [order id] END) * 39 COUNTD(如果 [订单状态] = 已取消且 [dtime] = 快递则 [订单 ID] END) * 39

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

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