Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
JacobJones
Creator
Creator

Applying 'good' or 'bad' tags to questions

Hi All,

I have a spreadsheet from a form. It asks questions like:

1. Did you drink two litres of water today?   <---Good

2 . Did you eat junk food?    <----Bad

3. Did you have a serving of vegetables?   <---Good

 

I want to be able distinguish between questions about 'good' things and questions about 'bad' things. So in the above example I need to flag 1 and 3 as good questions and 2 as bad questions. Then I want to count the amounts of yes in each category. I'm familiar with the idea of loading a table and then adding flags based on one field. 

 

Any help is greatly appreciated.

 

 

8 Replies
lorenzoconforti
Specialist II
Specialist II

Can you please provide a sample form.xlsx and a table in which you show the desired output?

JacobJones
Creator
Creator
Author

table.png

Result Table.png

 

This is simple version as an example. The real table has many questions.

 

lorenzoconforti
Specialist II
Specialist II

Not sure why in your example the first two rows only have a good count of 1; anyway, there are various ways of doing this

In your case I would do it like this (not very elegant but simple):


Data_temp:
Load * inline [
Date, YN Vegetables, YN Junk, YN Water
36526, Yes, Yes, No
36527, Yes, Yes, No
36528, No, No, Yes
];

Data:
Load *,
(if([YN Vegetables] = 'Yes',1,0) + if([YN Junk] = 'Yes',1,0) + if([YN Water] = 'Yes',1,0)) as Good,
(if([YN Vegetables] = 'No',1,0) + if([YN Junk] = 'No',1,0) + if([YN Water] = 'No',1,0)) as Bad
Resident Data_temp;

Drop table Data_temp;

JacobJones
Creator
Creator
Author

They have a score of 1 because there is only one yes for a good result.

Thanks for that solution. The issue is that I am looking to tag the questions,  not just count the results. Sorry if that wasn't clear. I've made the original question more clear.  

lorenzoconforti
Specialist II
Specialist II

If the solution I provided solved the problem, please mark the thread as solved

JacobJones
Creator
Creator
Author

The question is about tagging the field name not its result. I want to first know if it is a question about a good behavior or a bad behavior. Then I will add other tags, like it is about eating or exercise. The idea is that eventually one question will have multiple tags showing which categories it belongs to. Then I can look at the value and count results.

JacobJones
Creator
Creator
Author

I've resubmitted the question as this was unclear.

Kushal_Chawda

I am not sure this is what you are looking for, but I tried. Please verify the condition.

Data:
CrossTable(Description,Value)
LOAD
"Date",
if(lower(trim("YN Vegetables"))='yes','Good','Bad') as Vegetable_flag,
if(lower(trim("YN Junk"))='yes','Bad','Good') as Junk_flag,
if(lower(trim("YN Water"))='yes','Good','Bad') as Water_flag

FROM [lib://Download/Yes No Example.xlsx]
(ooxml, embedded labels, table is Sheet1);

Now, you can create a expression in chart

Good Count:

=Count({<Value={'Good'}>}Value)

Bad Count:

=Count({<Value={'Bad'}>}Value)