
1. Re: Total Innings Pitched in Decimal format
Stuart Fieldhouse Mar 1, 2018 9:15 AM (in response to jack.glavosek)Hi Jack,
How are you using Actual Innings? Is it the number of innings (full or partial) that a pitcher participated in? If so, then it's just CEILING([Innings Pitched]).
Stuart

2. Re: Total Innings Pitched in Decimal format
jack.glavosek Mar 1, 2018 9:34 AM (in response to Stuart Fieldhouse)1 of 1 people found this helpfulTo clarify: I'm not using actual innings. I created that formula as an interim step in the event that I needed to convert partial innings to thirds.
I should have omitted that measure from the table before posting.

3. Re: Total Innings Pitched in Decimal format
jack.glavosek Mar 2, 2018 2:21 PM (in response to jack.glavosek)I figured out a method of converting partial innings to full innings. I'm sure there's a more efficient approach but this works.
I converted a total of 33.8 innings to 35 completed innings with 2 extra outs.
The field is "Displayable Innings Pitched."
The new file is attached.

convert_innings.twbx 24.7 KB


4. Re: Total Innings Pitched in Decimal format
Mike Simon Oct 23, 2019 10:42 AM (in response to jack.glavosek)1 of 1 people found this helpful@jack.glavosek Can someone post the formula in this thread? I don't have a full version of Tableau  only public and i cant open this file. I need this calculation also.

5. Re: Total Innings Pitched in Decimal format
swaroop.gantela Oct 23, 2019 5:00 PM (in response to Mike Simon)Mike,
Maybe you can try this method.
I'm assuming in a game a pitcher has 1 inning 2 outs represented as 1.2
and then summing over games they could have 4.4 which would be 5 innings + 1/3.
So then I'd first calculate the total for each pitcher in decimal format:
{ FIXED [Pitcher]:SUM([Innings])}
Then get the number of fractional innings as the number of additional outs:
10 * ( [Innings Total per Pitcher]INT([Innings Total per Pitcher] ) )
Then using these two this would be the fractional version of the total:
STR(
INT([Innings Total per Pitcher]) //whole number part
+
INT ( [Outs additional] / 3 ) // divide by three to get additional innings from fractional part
)
+" "+
STR(ROUND( [Outs additional]%3,0 ) ) // use modulo 3 to get additional outs
+ "/3"
I've attached the datasource I used and the workbook in v2018.3 for others to check.

277986innings.twbx 28.2 KB

277986pitch.xlsx 8.2 KB


6. Re: Total Innings Pitched in Decimal format
swaroop.gantela Oct 23, 2019 5:02 PM (in response to Mike Simon)2 of 2 people found this helpfulMike,
For your reference, here is the calculated field that Jack used:
sum(int([Innings Pitched]))+
int((
sum([Innings Pitched])sum(int([Innings Pitched])))/.3)
+float(mid(
str(round((((
sum([Innings Pitched])sum(int([Innings Pitched])))/.3)
int((sum([Innings Pitched])sum(int([Innings Pitched])))/.3)),2)
),2,2))
/3 
7. Re: Total Innings Pitched in Decimal format
Mike Simon Oct 23, 2019 9:30 PM (in response to swaroop.gantela)1 of 1 people found this helpfulI can't open your tableau  you'd have to save it to tableau public first. I can't open a twbx
i will try to cut paste your formula tomorrow and let you know...

8. Re: Total Innings Pitched in Decimal format
Mike Simon Oct 23, 2019 9:30 PM (in response to Mike Simon)i actually used Jacks formula and it worked! I had issues with yours as i couldnt see the sheet to determine the values other variables you defined. I would still like to see it if possible.

9. Re: Total Innings Pitched in Decimal format
swaroop.gantela Oct 24, 2019 7:49 PM (in response to Mike Simon)1 of 1 people found this helpfulMike,
Sorry for the delay.
See if this link to it on public works: 
10. Re: Total Innings Pitched in Decimal format
Mike Simon Oct 25, 2019 6:58 PM (in response to jack.glavosek)Thanks a bunch this solved my problem!