
1. Re: Calculate highest Version average
Joe Oppelt Oct 7, 2016 8:27 AM (in response to Vamsi Immadisetty)If you're on V9.0 or higher, do a LOD to get the total count of rows.
Then do a window_max(count([Version]) to get the biggest COUNT. Divide that value by the initial count you did in the first calc, and you have the percent.If you need help pulling this together, create an excel file of the data, give it a shot, and upload the packaged workbook showing where you get stuck. (Be sure to tell us the version of Tableau you are using.)

2. Re: Calculate highest Version average
Ivan Young Oct 7, 2016 8:57 AM (in response to Vamsi Immadisetty) 
3. Re: Calculate highest Version average
Luciano Vasconcelos Oct 7, 2016 9:00 AM (in response to Vamsi Immadisetty)Ivan is also correct but shows all versions.
See this one.

4. Re: Calculate highest Version average
Vamsi Immadisetty Oct 7, 2016 10:40 AM (in response to Luciano Vasconcelos)Hi, thank you very much for your reply. It worked like a charm. JOE, IVAN and LUCIANO saved my time.

5. Re: Calculate highest Version average
Vamsi Immadisetty Oct 7, 2016 10:41 AM (in response to Luciano Vasconcelos)If I add any other dimension as filter, will these functions work or I have to include dimension in function itself

6. Re: Calculate highest Version average
Joe Oppelt Oct 7, 2016 12:16 PM (in response to Vamsi Immadisetty)It depends.
Do you want the percentage as a function of all the rows in the data source? Or just a function of the filtered set of data?
The denominator:
SUM({ FIXED : SUM([Number of Records])})
will get all the rows in the data source.

7. Re: Calculate highest Version average
Vamsi Immadisetty Oct 7, 2016 12:23 PM (in response to Joe Oppelt)let say I have one more dimension called Atype(Global, Segment). Some of these versions fall under Global and some are under Segment. If wanted to see Max version in Global and its percentage , Max version in Segment and its percentage.
Either I should be able to add Atype in filter or have to calculate in separate calculations.

8. Re: Calculate highest Version average
Joe Oppelt Oct 7, 2016 12:25 PM (in response to Vamsi Immadisetty)It's time to upload a sample packaged workbook so that we can be talking about a concrete example. I'm struggling to juggle all the factors involved now.

9. Re: Calculate highest Version average
Vamsi Immadisetty Oct 7, 2016 12:48 PM (in response to Joe Oppelt)Hi Joe, Attached is the data deck and calculation.

Sample worksheet.xlsx 9.1 KB


10. Re: Calculate highest Version average
Joe Oppelt Oct 7, 2016 1:28 PM (in response to Vamsi Immadisetty)See attached.
Sheet 1 is your data with percentages by Version. Calculation2 does the calc offered by Luciano.
Sheet 2 is just the max version displayed.
Sheet 3 has added Atype. Calculation3 modified Calc2 to take [Atype] into consideration, but we're still dividing by the total sum of rows in the data source. (So all the individual calcs on this sheet add up to 1.00.)
Sheet 4 has added [Atype] in to the denominator (in Calculation 4) so that you get percentages by [Atype].
Sheet 5 modified the filter to look at Calculation 4 instead of calculation 2, and grabs the largest for each [Atype].

Atype  A.twbx 61.2 KB


11. Re: Calculate highest Version average
Joe Oppelt Oct 7, 2016 1:29 PM (in response to Joe Oppelt)I did this workbook in V9.0 so that whatever version you are using will still be able to read this. (Unless you are on 8.x, in which case all this needs to be redone because LODs weren't in 8.x.)

12. Re: Calculate highest Version average
Vamsi Immadisetty Oct 9, 2016 11:25 PM (in response to Joe Oppelt)Hi Joe, million thanks for your reply. I have one last clarification what if I wanted to get the latest version by Atype. Like
Atype Latest Version Average
Segment 6.2.342 26%
Global 6.3.51 20%
I tried apply max function in LOD function but not getting exact result as I am expecting. I am using the Tableau Version 10.0.0

13. Re: Calculate highest Version average
Joe Oppelt Oct 10, 2016 7:57 AM (in response to Vamsi Immadisetty)Sheet 6 is a duplicate of sheet 4. I created a calc that just increments whenever there is a new Version down the chart. I placed it on TEXT so you can see how it works. I did TABLE(down) on that calc so that it evaluates in the proper direction.
Sheet 7 is a duplicate of 6. I added a calc that I will eventually use as a filter. This calc looks at the prior calc and also looks to see if the current version is NULL. When I get to the MAX [Running Count], and if the value is not null, then set the calc to 1. You can see in the display that it gets set to 1 for the highest [Running Count] that is not null. I also set this to TABLE(DOWN).
Sheet 8 is a duplicate of 7. I took [Running Count] off the TEXT shelf. Ditto [Get Max...]. I dragged Get Max to the filter shelf and told it to select only for value = 1. Now you just get the two rows where that value is 1.

Atype  B.twbx 100.1 KB


14. Re: Calculate highest Version average
Vamsi Immadisetty Oct 11, 2016 12:37 PM (in response to Joe Oppelt)Hi Joe, thank you very much for step by step procedure. It is flawless explanation and you saved my day. I did little modification to the code.
Step 1 : Separated both AType in two dimensions IF [AType]='Global' THEN [Version] ELASE '0' END
Step 2 : I captured the max version in two different dimensions crated in Step 1 (for both segments)
 {FIXED [AType] : MAX([ATypeVersions])}
Step 3 : Calculate average for Highest version by segment in different dimension using IF condition
COUNT(IF [Version]=[GlobalLatestVersion] THEN 1 END)/SUM([Number of Records])
Finally created two different sheets for Global and Segment and added them in dashboard.