Welcome to the LimeSurvey Community Forum

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

Choose a brand at random

  • Vic1107
  • Vic1107's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 3 months ago #244834 by Vic1107
Choose a brand at random was created by Vic1107
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
(Write here your question/remark)

Hello friends of the forum.

I want to ask if anyone has an idea about my problem.


I have a list of coffee shop brands, which select which ones you have visited,

Now of the selected brands, 1 brand is randomly asked when was your last visit and some additional questions.

So far so good, since I used the "Join" expression to join the marks and then the rand to choose this mark randomly.

But I want to focus on two brands specifically, that is, I am interested in evaluating code and code 7 by majority, so if they select the brands

1
3
4
5

I want it to always show me mark 5 as a priority.

If they select:

1
2
5
7

I want it to randomly show me by priority brand 5 or 7, one of the two priority ones.


if they select brands

1
2
3
4
6

It would not have any problem that any of the 5 selected ones is randomly displayed.

I hope I have been a bit precise in my explanations, my English is not very good.

I also share an lss survey for better reference.

Thank you all for your great help.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 3 months ago - 1 year 3 months ago #244837 by Joffm
Replied by Joffm on topic Choose a brand at random
Hi,
why didn't you answer the questions at the beginning about your version, your hosting, etc.

But it is very easy to realize
Change the equation in "eqBrands" to
{if(P0401_5=="Y" OR P0401_7=="Y", join(if(P0401_5=="Y","E",""), if(P0401_7=="Y","G","")), join(if(P0401_1=="Y","A",""), if(P0401_2=="Y","B",""), if(P0401_3=="Y","C",""), if(P0401_4=="Y","D",""), if(P0401_6=="Y","F",""), if(P0401_8=="Y","H",""), if(P0401_12=="Y","L","")))}

You see if one or both of your priorized brands were selected only these get into "eqBrands", else the other brands are entered.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 3 months ago by Joffm.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose