Reputation: 3
From the Image I need to calculate % complete for the order number 1.
Calculation for complete will be
(total number of points for status 'Delivered' / total number of points)*100
The value should be 57%
Can some one help with the calculated field?
Upvotes: 0
Views: 106
Reputation: 11921
You can also get the effect you want, just by manipulating the Tableau user interface -- without needed to write calculated fields as @S. User18 showed. Both approaches work, but it helps to understand both alternatives.
As with @S. User18, I assume your column named Order No. is consistently filled in. I also assume [Order No.] is a dimension.
This shows the sum of the number of Points for each combination of the two dimensions: [Order No.] and [Status]
To understand more about Table Calculations, see the online help.
Upvotes: 0
Reputation: 712
Look at IIF in help files
SUM(IIF([Status]="Delivered",[Point],NULL)) / SUM([Point])
I assume your column named Order No. extends all the way down each row (i.e., each row should have a 1 as Order No. but the screenshot does not show that.
Also, the above only works if the status of "Delivered" is consistently cased, which it is not in the screenshot. If it is not consistently cased, wrap [Status] in an Upper function:
SUM(IIF(UPPER([Status])="DELIVERED",[Point],NULL)) / SUM([Point])
Upvotes: 1