Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Finding highest-rated subquest in multiple LimeSurvey matrices.

  • Verweisst
  • Verweisst's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 week 2 days ago #270710 by Verweisst
Please help us help you and fill where relevant:
LimeSurvey version: Version 6.12.4+250408 
Own server or LimeSurvey Cloud:
Survey theme/template: Fruity
==================

Hello everyone,I’m new to LimeSurvey and currently working on a survey that includes multiple double-matrix questions (3 matrices with about 10 subitems each, so roughly 30 subitems in total).My challenge:

I want to identify which subquestion were rated as most important about all matrices because I plan to include a follow-up question asking respondents why they rated certain subitems as most important. I built an ExpressionScript formula that compares the values of the subitems and returns the one with the highest score, but it became very large (see below). This works for one matrix and returns the first maximum value found. However, for 30 subitems, I would need to greatly expand this, which becomes very complex and hard to maintain.My questions:
  1. Is there a more elegant or efficient way in LimeSurvey to check multiple Subquestions for their maximum value and response the name of the subquestion and dynamically identify multiple top Subquestions (e.g., if several subquestions share the highest rating)?
  2. Or do I have to extend and nest these ExpressionScript formulas for each matrix and every subitem?
My ExpressionScript:
{if(CEditQ01Part1_SQ001_0.NAOK == max(CEditQ01Part1_SQ001_0.NAOK,CEditQ01Part1_SQ002_0.NAOK,CEditQ01Part1_SQ003_0.NAOK,CEditQ01Part1_SQ004_0.NAOK,CEditQ01Part1_SQ005_0.NAOK,CEditQ01Part1_SQ006_0.NAOK,CEditQ01Part1_SQ007_0.NAOK,CEditQ01Part1_SQ008_0.NAOK,CEditQ01Part1_SQ009_0.NAOK,CEditQ01Part1_SQ010_0.NAOK), 'SQ001', if(CEditQ01Part1_SQ002_0.NAOK == max(CEditQ01Part1_SQ001_0.NAOK,CEditQ01Part1_SQ002_0.NAOK,CEditQ01Part1_SQ003_0.NAOK,CEditQ01Part1_SQ004_0.NAOK,CEditQ01Part1_SQ005_0.NAOK,CEditQ01Part1_SQ006_0.NAOK,CEditQ01Part1_SQ007_0.NAOK,CEditQ01Part1_SQ008_0.NAOK,CEditQ01Part1_SQ009_0.NAOK,CEditQ01Part1_SQ010_0.NAOK), 'SQ002', if(CEditQ01Part1_SQ003_0.NAOK == max(CEditQ01Part1_SQ001_0.NAOK,CEditQ01Part1_SQ002_0.NAOK,CEditQ01Part1_SQ003_0.NAOK,CEditQ01Part1_SQ004_0.NAOK,CEditQ01Part1_SQ005_0.NAOK,CEditQ01Part1_SQ006_0.NAOK,CEditQ01Part1_SQ007_0.NAOK,CEditQ01Part1_SQ008_0.NAOK,CEditQ01Part1_SQ009_0.NAOK,CEditQ01Part1_SQ010_0.NAOK), 'SQ003', if(CEditQ01Part1_SQ004_0.NAOK == max(CEditQ01Part1_SQ001_0.NAOK,CEditQ01Part1_SQ002_0.NAOK,CEditQ01Part1_SQ003_0.NAOK,CEditQ01Part1_SQ004_0.NAOK,CEditQ01Part1_SQ005_0.NAOK,CEditQ01Part1_SQ006_0.NAOK,CEditQ01Part1_SQ007_0.NAOK,CEditQ01Part1_SQ008_0.NAOK,CEditQ01Part1_SQ009_0.NAOK,CEditQ01Part1_SQ010_0.NAOK), 'SQ004', if(CEditQ01Part1_SQ005_0.NAOK == max(CEditQ01Part1_SQ001_0.NAOK,CEditQ01Part1_SQ002_0.NAOK,CEditQ01Part1_SQ003_0.NAOK,CEditQ01Part1_SQ004_0.NAOK,CEditQ01Part1_SQ005_0.NAOK,CEditQ01Part1_SQ006_0.NAOK,CEditQ01Part1_SQ007_0.NAOK,CEditQ01Part1_SQ008_0.NAOK,CEditQ01Part1_SQ009_0.NAOK,CEditQ01Part1_SQ010_0.NAOK), 'SQ005', if(CEditQ01Part1_SQ006_0.NAOK == max(CEditQ01Part1_SQ001_0.NAOK,CEditQ01Part1_SQ002_0.NAOK,CEditQ01Part1_SQ003_0.NAOK,CEditQ01Part1_SQ004_0.NAOK,CEditQ01Part1_SQ005_0.NAOK,CEditQ01Part1_SQ006_0.NAOK,CEditQ01Part1_SQ007_0.NAOK,CEditQ01Part1_SQ008_0.NAOK,CEditQ01Part1_SQ009_0.NAOK,CEditQ01Part1_SQ010_0.NAOK), 'SQ006', if(CEditQ01Part1_SQ007_0.NAOK == max(CEditQ01Part1_SQ001_0.NAOK,CEditQ01Part1_SQ002_0.NAOK,CEditQ01Part1_SQ003_0.NAOK,CEditQ01Part1_SQ004_0.NAOK,CEditQ01Part1_SQ005_0.NAOK,CEditQ01Part1_SQ006_0.NAOK,CEditQ01Part1_SQ007_0.NAOK,CEditQ01Part1_SQ008_0.NAOK,CEditQ01Part1_SQ009_0.NAOK,CEditQ01Part1_SQ010_0.NAOK), 'SQ007', if(CEditQ01Part1_SQ008_0.NAOK == max(CEditQ01Part1_SQ001_0.NAOK,CEditQ01Part1_SQ002_0.NAOK,CEditQ01Part1_SQ003_0.NAOK,CEditQ01Part1_SQ004_0.NAOK,CEditQ01Part1_SQ005_0.NAOK,CEditQ01Part1_SQ006_0.NAOK,CEditQ01Part1_SQ007_0.NAOK,CEditQ01Part1_SQ008_0.NAOK,CEditQ01Part1_SQ009_0.NAOK,CEditQ01Part1_SQ010_0.NAOK), 'SQ008', if(CEditQ01Part1_SQ009_0.NAOK == max(CEditQ01Part1_SQ001_0.NAOK,CEditQ01Part1_SQ002_0.NAOK,CEditQ01Part1_SQ003_0.NAOK,CEditQ01Part1_SQ004_0.NAOK,CEditQ01Part1_SQ005_0.NAOK,CEditQ01Part1_SQ006_0.NAOK,CEditQ01Part1_SQ007_0.NAOK,CEditQ01Part1_SQ008_0.NAOK,CEditQ01Part1_SQ009_0.NAOK,CEditQ01Part1_SQ010_0.NAOK), 'SQ009', 'SQ010')))))))))}
   

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 week 2 days ago #270717 by holch
I can't answer your question, but you should provide an LSS file, not the LSQ.

Reason being, the LSQ and LSG files are language sensitive and you need to get the base language right to be able to import the question.

Also, you should help people to help you. With a LSQ file the helpers all need to create a survey (hopefully in the correct base language), then a question group and then import the LSQ file. And every helper has to do this, so a lot of time wasted.

If you provide a LSS file this can be imported directly by everyone and test straight away.

So copy your survey, delete everything that is not necessary for the issue and export it as LSS file and then upload it here. It helps people to help.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 week 1 day ago - 1 week 1 day ago #270725 by Joffm
Hi,
yes, you can shorten it a lot.
As I see, you only want to get the subquestion code(s) of the maximum.

Here I created something like that
 

As @holch, provide a lss export of this relevant question.

Joffm

And, please, elaborate this.

because I plan to include a follow-up question asking respondents why they rated certain subitems as most important.

Do you want to include ONE follow-up question, like  (here - as you see - items from three different questions - name, fruit, car)
"You rated Doris Dachs, Jaqueline Jaguar, Carambola, Feige, Guave, Goggomobil, Jaguar highest. Please, explain, why these items are the most important for you"
A question of type "long text"

Or do you want to ask this for each single highest rated item?
Like
"Please, specify, why the following items are the most important for you!"
A question of type "multile short text"
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 week 1 day ago by Joffm.

Please Log in to join the conversation.

  • Verweisst
  • Verweisst's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 week 1 day ago - 1 week 1 day ago #270738 by Verweisst
Hi,
sorry for my late reply. I've now added the three matrices to the LSS. Hope it's correct now. And thanks again for the tip about LSG files. I didn't know that.

@Joffm Yes, I wanted to create a follow-up question for each of the most selected items, either with a free text field or multiple short text fields, if that works better (If this is too complicated with multiple questions I would also put it in a long free text question). I intended to do it just like in your screenshot. Is that very complicated?


Thanks a lot for your help!
Last edit: 1 week 1 day ago by Verweisst.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose