
1. Re: Formatting Percent and Numbers in the same sheet / Calculated field destroys formatting
Matt Lutton Dec 3, 2013 7:41 AM (in response to Stacey Rothchild)Is there any chance of posting the workbook, or creating another one that demonstrates the issue using sample data?

2. Re: Formatting Percent and Numbers in the same sheet / Calculated field destroys formatting
bill.cunningham Dec 3, 2013 8:01 AM (in response to Stacey Rothchild)Have you tried taking a look at this post yet: Unexpected Results: Rounding  Drawing with Numbers
As Matthew mentioned, you're much more likely to get a quick response if you post a packaged workbook.
Good luck!

3. Re: Formatting Percent and Numbers in the same sheet / Calculated field destroys formatting
Stacey Rothchild Dec 3, 2013 8:05 AM (in response to bill.cunningham)Yes  Jonathan posted in the previous post with that solution, but using the string and round functions it returns 17 decimal places. I need the string function to add the percent symbol at the end.
I will work on posting a workbook  I have to work on creating a duplicate as this one has confidential info in it.

4. Re: Formatting Percent and Numbers in the same sheet / Calculated field destroys formatting
Dan Huff Dec 3, 2013 8:09 AM (in response to Stacey Rothchild)1 of 1 people found this helpfulYou could try using some combination of find() and left() to get around the extra decimals. For example, say you want 2 decimals, your calculation would look something like this:
left(str([Rate]) , find(str([Rate]),"." + 2 ) + "%"
This may take some experimentation but it may do the trick.
I hope this helps get you in the right direction.
Dan

5. Re: Formatting Percent and Numbers in the same sheet / Calculated field destroys formatting
Matt Lutton Dec 3, 2013 8:17 AM (in response to Dan Huff)That is a method used here for adding comma separators, but I didn't have to do much for the percentages to work. I know the OP has already seen this, but figured I could link it here anyway as others have similar issues:
http://community.tableau.com/docs/DOC5245
A calculation in that workbook is:
CASE[Choose Measure]
when "Sales" then
IF len(str([Sum Sales]))<3 THEN
"$" + str([Sum Sales])
ELSEIF len(str([Sum Sales]))<=6 THEN
"$" + LEFT(str([Sum Sales]), Len(str([Sum Sales]))3)
+ "," + RIGHT(str([Sum Sales]), 3)
ELSEIF len(str([Sum Sales]))<=9 THEN
"$" + LEFT(str([Sum Sales]), Len(str([Sum Sales]))6)
+ "," + MID(RIGHT(str([Sum Sales]), 6), 1, 3) + ","
+ RIGHT(str([Sum Sales]), 3)
ELSEIF len(str([Sum Sales]))<=12 THEN
"$" + LEFT(str([Sum Sales]), Len(str([Sum Sales]))9)
+ "," + MID(RIGHT(str([Sum Sales]), 9), 1, 3)
+ "," + MID(RIGHT(str([Sum Sales]), 6), 1, 3) + ","
+ RIGHT(str([Sum Sales]), 3)
ELSEIF len(str([Sum Sales]))<=15 THEN
"$" + LEFT(str([Sum Sales]), Len(str([Sum Sales]))12)
+ "," + MID(RIGHT(str([Sum Sales]), 12), 1, 3)
+ "," + MID(RIGHT(str([Sum Sales]), 9), 1, 3)
+ "," + MID(RIGHT(str([Sum Sales]), 6), 1, 3) + ","
+ RIGHT(str([Sum Sales]), 3)
ELSE
"More than 100 Trillon Dollars"
ENDwhen "Ratio" then str(round(sum(Profit)/([Sum Sales])*100, 2))+"%"
end 
6. Re: Formatting Percent and Numbers in the same sheet / Calculated field destroys formatting
Stacey Rothchild Dec 3, 2013 8:25 AM (in response to Dan Huff)I will try this  maybe it will work instead of the round function.
I'm still working on trying to recreate both my data and workbook so I can post it here if the find/left does not work.

7. Re: Formatting Percent and Numbers in the same sheet / Calculated field destroys formatting
Stacey Rothchild Dec 3, 2013 8:44 AM (in response to Stacey Rothchild)For right now I posted an image of Tableau  I'm still working on changing the data. (not sure if there is a more efficient way to do this for my huge dataset. I've read a couple of posts and am working through them)
The "RateNorPWithSymbol" is a calculated field:
IIF ([CalculationType]=2, (str(ROUND([RateNorP],2))+"%"),str([RateNorP]))

8. Re: Formatting Percent and Numbers in the same sheet / Calculated field destroys formatting
Matt Lutton Dec 3, 2013 8:46 AM (in response to Stacey Rothchild)1 of 1 people found this helpfulThis is my "go to" post on removing sensitive data:
http://community.tableau.com/message/213297#213297
Might want to vote for ideas related to data scrambling or more sample data: