Export a categorical question (MCQ w optional text) as single column in csv?

More
1 month 4 weeks ago #203314 by daaronr
I've many survey questions that are MCQ with optional text boxes. I want to export to csv to input to R.

The export function seems to always export these as multiple dummy columns.

I just want each to be a single dummy column. How can this be done?

Please Log in to join the conversation.

LimeSurvey Partners
More
1 month 4 weeks ago #203320 by Joffm
As this is the usual way to export multipunch question there is no way to do this.

No way?
Well, you may try to create a question of type equation and use the "list"- or "join"-function to generate a string in one column.
See "Implemented functions" in the manual.

Tell us how you would like to have the output.

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 month 4 weeks ago #203322 by daaronr
Thanks. Suppose the question asks:

"Which colors do you like?"

A. Red
B. Blue
C. Green

I would like it to export responses such as
1. "Red", "Blue"
2. "Red"
3. "Blue"
4. "Blue", "Green"

Please Log in to join the conversation.

More
1 month 4 weeks ago - 1 month 4 weeks ago #203323 by gabrieljenik
Hi,

This could be achieved by creating a custom export plugin.
Please feel free to contact us at This email address is being protected from spambots. You need JavaScript enabled to view it. if you need assistance creating one.


Thanks!

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Checkout our Reporting Solutions and our plugin shop at www.encuesta.biz .

Last edit: 1 month 4 weeks ago by gabrieljenik.

Please Log in to join the conversation.

More
1 month 4 weeks ago - 1 month 4 weeks ago #203324 by Joffm
This you may get by using the "list"-function
{list(that.Q1.shown)}




If desired you may add the quotes by some equations like "str_replace" to replace the ',' with '","'
and add a leading and trailing quote.

{join('"',str_replace(', ','","',list(that.Q1.shown)),'"')}


Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
Last edit: 1 month 4 weeks ago by Joffm.
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

More
1 month 3 weeks ago #203347 by Joffm
Just to add:
If the answer to the multiple question may be empty you have to add an IF-statement.
Otherwise your result will still have the two double quotes.

{if(count(that.Q1)>0,join('"',str_replace(', ','","',list(that.Q1.shown)),'"'),"")}

Don't get confused about single quotes and double quotes. Therefore the double quotes in red,

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now