首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Tableau -满足IF条件的多条记录

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

Stack Overflow用户
提问于 2021-03-17 07:21:14
回答 1查看 41关注 0票数 1

我希望在tableau中有多个符合标准的值。

例如:

代码语言:javascript
复制
if [order status] = cancelled and [dtime] = express then 39 
else other end (so it counts number of records *39) 

我需要的是不计算记录的数量,而是所有唯一的order_id,所以我使用:

代码语言:javascript
复制
if [order status] = cancelled and [dtime] = express then (countd[order id] * 39)

但这是行不通的。

场景:COUNTD(如果

探险类型= "ZEX“,计数bigboxy aj smallboxy = "BIGBOX”和Transporter = "Mall Box“,然后订购Id * 260.6

代码语言:javascript
复制
 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)

EN

回答 1

Stack Overflow用户

发布于 2021-03-17 23:48:39

COUNTD(如果订单状态=已取消且dtime = express,则订单id结束)* 39

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66664856

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档