[英]Tableau - multiple records that meet IF condition
我想要多个符合画面标准的值。
例如:
if [order status] = cancelled and [dtime] = express then 39
else other end (so it counts number of records *39)
我需要的是不计算记录的数量,而是所有唯一的order_id
,所以我使用了:
if [order status] = cancelled and [dtime] = express then (countd[order id] * 39)
但这不起作用。
场景:COUNTD(如果
[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(如果 [订单状态] = 已取消且 [dtime] = 快递则 [订单 ID] END) * 39
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.