6 Replies Latest reply on Apr 10, 2018 11:04 AM by Jim Dehner

# Need help with Calculation

I have country , customer and status column in data.

I need help with calculation where If all are green its is 100% for country. For eg in US , all customer have green status so its 100%. For UK , out of 2 customer one has amber status so its 50 %.

I need below output. Attached workbook.

 Country Customer Status Percentage US 100 Green 100% US 101 Green US 102 Green US 103 Green Uk 105 Green 50% Uk 108 Amber
• ###### 1. Re: Need help with Calculation

You can use LODs for this. I'd suggest creating the following calculated fields:

Is Green

IF [Status]="Green" THEN

1

ELSE

0

END

Total Records for Country

{FIXED [Country]: SUM([Number of Records])}

Total Green for Country

{FIXED [Country]: SUM([Is Green])}

Green Percentage

[Total Green for Country]/[Total Records for Country]

Then you can drop Green Percentage on the Rows shelf and change it to discrete. That should give you what you need. See the attached.

1 of 1 people found this helpful
• ###### 2. Re: Need help with Calculation

please see the attached approach using an LOD

first assign a value to green

then determine a percentage

it returns this

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• ###### 3. Re: Need help with Calculation

I am unable to open the Twbx file.it gives error.

can you attach the screenshot

• ###### 4. Re: Need help with Calculation

Awesome. Thank you!!

• ###### 5. Re: Need help with Calculation

Thank youuu !!

• ###### 6. Re: Need help with Calculation

Thanks