5 Replies Latest reply on Oct 13, 2018 9:31 PM by Mahfooj Khan

Is there a way to turn a percent into a fraction?

I have a college football dataset that calculated the percent of games won each season. For instance, one column in the data says that "Team A" won 80% (or 0.8) of its games that season. Is there a way in Tableau to turn that decimal into a fraction so I could say "Team A won 4 out of 5 games"?

• 1. Re: Is there a way to turn a percent into a fraction?

If you have a column for "Games Played" and "Games Won" then you could use these fields to display in tooltip right? Or are you wanting to display this in the viz?

• 2. Re: Is there a way to turn a percent into a fraction?

Do you have the total number of games of each team??

if you have this information you can create a new calculated field 'num_win' :

[the percent of games won each season] * [total number of games]

OR

([the percent of games won each season] * [total number of games] )/100

It depends on the percent of games won each season, for example, in your case :

[the percent of games won each season]= 0,8

and [total number of games]=5

then 'num_win'= 0,8*5

Alexander Elfering

• 3. Re: Is there a way to turn a percent into a fraction?

Hi Alexander,

I am not sure you are looking for this but use below calculation to find desired output.

I have attached workbook for your reference. Please let me know if this is what you are looking for.

• 4. Re: Is there a way to turn a percent into a fraction?

Well try

if Won > 0 then  STR(5*Won )+"/"+"5"

else "0"+"/"+"5"

end

• 5. Re: Is there a way to turn a percent into a fraction?

Hi,