saska
saska

Reputation: 73

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:

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

but this does not work.

scenario : COUNTD(If

[Expedition Type] = "ZEX" and [count bigboxy aj smallboxy] = "BIGBOX" and [Transporter] = "Mall Box" then [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)

enter image description here

Upvotes: 1

Views: 210

Answers (1)

Andy TAR Sols
Andy TAR Sols

Reputation: 1735

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

Upvotes: 1

Related Questions