Tableau Case statement
Create Tableau Case statement using a measure and a dimension:
CASE [Age Group]
WHEN 'm_13_17' THEN [Mf Count]
WHEN 'm_18_24' THEN [Mf Count]
WHEN 'm_25_34' THEN [Mf Count]
WHEN 'm_35_44' THEN [Mf Count]
WHEN 'm_45_54' THEN [Mf Count]
WHEN 'm_55_64' THEN [Mf Count]
WHEN 'm_55_64' THEN [Mf Count]
END
Or

Otherwise use the IF statement as below:
IF CONTAINS([Reporting Platform], 'facebook') THEN 'Facebook'
ELSEIF CONTAINS([Reporting Platform], 'instagram') THEN 'Instagram'
ELSEIF CONTAINS([Reporting Platform], 'facebook') AND CONTAINS([Reporting Platform], 'instagram') THEN 'Both'
ELSE 'Other'
OR better one below:
IF [Total Delay Mins]>=6 AND [Total Delay Mins]<=10 THEN "6 to 10 Minutes"
ELSEIF [Total Delay Mins]>10 AND [Total Delay Mins]<=15 THEN "10 to 15 Minutes"
ELSEIF [Total Delay Mins]>15 AND [Total Delay Mins]<=20 THEN "15 to 20 Minutes"
ELSEIF [Total Delay Mins]>20 THEN "20+ Minutes"
ELSE "0"
END
END
Comments
Post a Comment