2 Replies Latest reply on Aug 28, 2018 12:04 PM by Jim Dehner

# STR(ROUND([Spot Cad],2)) + "\$" is not showing the desired result

Hi,

I'm using the following calculated filed in order to show in the following format:

 1,31 \$ 1,49 \$ 1,67 \$ 84,47 ¥ 0,96 \$

if [Cur Cd] ='JPY' THEN STR(ROUND( (1/[Spot Cad]),2)) + "¥"

ELSEIF [Cur Cd] ='USD' THEN  STR(ROUND([Spot Cad],2)) + "\$"

ELSE  STR(ROUND([Spot Cad],2)) + "\$"  END

However the result show in tableau is as follows Any help will be greatly appreciated.

• ###### 1. Re: STR(ROUND([Spot Cad],2)) + "\$" is not showing the desired result

if [Cur Cd] ='JPY' THEN STR(ROUND( SUM(1/[Spot Cad]),2)) + "¥"

ELSEIF [Cur Cd] ='USD' THEN  STR(ROUND(SUM([Spot Cad]),2)) + "\$"

ELSE  STR(ROUND(SUM([Spot Cad]),2)) + "\$"  END

Check for Brackets

May be this also:

if ATTR([Cur Cd]) ='JPY' THEN STR(ROUND( SUM(1/[Spot Cad]),2)) + "¥"

ELSEIF ATTR( [Cur Cd]) ='USD' THEN  STR(ROUND(SUM([Spot Cad]),2)) + "\$"

ELSE  STR(ROUND(SUM([Spot Cad]),2)) + "\$"  END

1 of 1 people found this helpful
• ###### 2. Re: STR(ROUND([Spot Cad],2)) + "\$" is not showing the desired result

Hi

try aggregating your measure Spot Cat  I'm guessing avg is correct could be amx or min

if [Cur Cd] ='JPY' THEN STR(ROUND( (1/avg([Spot Cad])),2)) + "¥"

ELSEIF [Cur Cd] ='USD' THEN  STR(ROUND(avg([Spot Cad]),2)) + "\$"

ELSE  STR(ROUND(avg(([Spot Cad]),2)) + "\$"  END

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

1 of 1 people found this helpful