-
1. Re: IF ELSEIF THEN Statement Help!
Vinnie Ahuja Jun 14, 2018 3:07 PM (in response to Arron Robles)try putting attr() around [Emp Type] and [Position Tenurecount] in all of your IF/ELSEIF clauses
-
2. Re: IF ELSEIF THEN Statement Help!
Joe OppeltJun 14, 2018 3:20 PM (in response to Arron Robles)
IF [Emp Type] = "BAE1SMBSLS"
and
( [Position Tenurecount] = '0_3_Months'
or [Position Tenurecount] = '4_6_Months'
or [Position Tenurecount] = '7_12_Months' )
THEN sum([Data])+sum([Voice])+sum([Video])
ELSEIF [Emp Type] = "BAE1SMBSLS"
and
( [Position Tenurecount] = '13_24_Months'
or [Position Tenurecount] = '25_Plus_Months' )
THEN sum([Data])+sum([Voice])+sum([Video])
ELSEIF [Emp Type] = "BAE3SMBSLS"
THEN sum([AV])
else 0
END
-
3. Re: IF ELSEIF THEN Statement Help!
Joe OppeltJun 14, 2018 3:21 PM (in response to Joe Oppelt)
And yes. Vinnie is right about ATTR() in the dimension fields.
-
4. Re: IF ELSEIF THEN Statement Help!
Chris McClellanJun 14, 2018 3:22 PM (in response to Arron Robles)
Without testing in Tableau, I think you will need this:
IF attr([Emp Type]) = "BAE1SMBSLS" and ( attr([Position Tenurecount]) = '0_3_Months' OR attr([Position Tenurecount]) = '4_6_Months' OR attr([Position Tenurecount]) = '7_12_Months' ) THEN sum([Data])+sum([Voice])+sum([Video]) ELSEIF attr([Emp Type]) = "BAE1SMBSLS" and ( attr([Position Tenurecount]) = '13_24_Months' OR attr([Position Tenurecount]) = '25_Plus_Months' ) THEN sum([Data])+sum([Voice])+sum([Video]) ELSEIF attr([Emp Type]) = "BAE3SMBSLS" THEN sum([AV]) else 0 END
-
5. Re: IF ELSEIF THEN Statement Help!
Arron Robles Jun 14, 2018 3:36 PM (in response to Chris McClellan)Hi Chris. This worked for me adding the ATTR() and removing the sum() form the statement fixed the issues.
IF attr([Emp Type]) = "BAE1SMBSLS"
and ( ATTR([Position Tenurecount]) = '0_3_Months'
OR ATTR([Position Tenurecount]) = '4_6_Months'
OR ATTR([Position Tenurecount]) = '7_12_Months' )
THEN [Data]+[Voice]+[Video]
ELSEIF ATTR([Emp Type]) = "BAE1SMBSLS"
and ( attr([Position Tenurecount]) = '13_24_Months'
OR ATTR([Position Tenurecount]) = '25_Plus_Months' )
THEN [Data]+[Voice]+[Video]
ELSEIF ATTR([Emp Type]) = "BAE3SMBSLS"
THEN [AV]
else 0
Cheers,
Arron