6 Replies Latest reply on Feb 7, 2019 10:29 AM by Jim Dehner

# Calculation Help

Hi everyone, I'm fairly new to Tableau calculations and am hoping someone can help me. I'm putting some survey data into tableau. All of the answers consist of yes/no questions. I created calculated fields to count the YESs and NOs and i'm not trying to get a percentage. I want a calculated field that counts the total YESs/divided by the number of questions so I have a perctange of what they answered yes vs no. I tried but am not getting in right. Any advice?

Thank you.

• ###### 1. Re: Calculation Help

HI Melissa,

When opening your workbook a password is requested. Please attach data to the workbook and attach it once again as a .tbwx file

Regards,

Norbert

• ###### 2. Re: Calculation Help

Calc Field:

{ fixed [IndividualQuestions]: Sum([Yes]) / Sum([Response]) }

• ###### 3. Re: Calculation Help

but the approach to use is to create 2 lod expressions that are like {fixed [partner] : sum(if response ' Yes' then 1 else 0)} and the same to No

then you can use those to do the sum and division

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.

• ###### 4. Re: Calculation Help

Thanks for the feedback, I've tried again attaching it, not sure if it will work.

• ###### 5. Re: Calculation Help

Here it is:

Thanks

Deepak

If it Helps, Pl Mark it Helpful and CORRECT to Close Thread

Add FILTERS TO CONTEXT, I did That in attachment because LODs will work only Then.

• ###### 6. Re: Calculation Help

see the attached

this is no and yes at the individual question level

and this is the % - wanted to avoid the table calculation - you will understand as you get further into tableau

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.