5 Replies Latest reply on Apr 3, 2018 11:04 AM by Deepak Rai

# Comparison of data with multiple questions on different rows to find Percentages

How to do a comparison of data by Employee ID for 2 different rows where there are multiple questions? I want to compare data for only 2 of the 4 questions which is "now" and "later".  I would like to compare the first 2 rows for each employee where the flag =1 for the same employee ID and for the same food item selected.   So for this scenario based on the Tableau Package attached it would be 2 out of 5 people met this criteria since employee #4 selected hamburgers for both choices and employee #5 selected Ice cream for both choices for questions "now" and later".

Since employee #4 and employee #5 have their flag =1 for the same food item the total number of employees that qualify are 2 out of 5  or 40% of the employees prefer the same food "now" and "later".

I tried entering a filter to only select questions "now" and "later" but it didn't produce accurate results.

• ###### 1. Re: Comparison of data with multiple questions on different rows to find Percentages

Wendy,

Your logic is CORRECT. Since you are using LOD you need to add FILTER to CONTEXT.

Thanks

Deepak

• ###### 2. Re: Comparison of data with multiple questions on different rows to find Percentages

That is strange.  When I add the filter it doesn't work and shows 80% not 40%.  Any ideas?

• ###### 3. Re: Comparison of data with multiple questions on different rows to find Percentages

RIGHT CLICK on SURVEY QUESTION FILTER

a menu will open Select ADD to CONTEXT and Check

1 of 1 people found this helpful
• ###### 4. Re: Comparison of data with multiple questions on different rows to find Percentages

Deepak,

Thank you so much!!! You are a genius!! It worked.  I now know how to use the Add to Context functionality!! I appreciate all of your help!!

1 of 1 people found this helpful
• ###### 5. Re: Comparison of data with multiple questions on different rows to find Percentages

..Please Close The Thread by marking my Reply as CORRECT.

Thanks

Deepak