Welcome to the LimeSurvey Community Forum

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

exclude a variable by substitution

  • Fran1991
  • Fran1991's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 5 months ago #221120 by Fran1991
exclude a variable by substitution was created by Fran1991
Hello dear forum, I hope you are all very well.

I tell you that I am in a dilemma with a question from the questionnaire that I am currently asking, it may be something simple but I have not been able to advance.

I have two questions, let's call them P1 and P2.

In P1 asks about the suppliers you have worked with on a list of 16 suppliers. (Multiple choice question)

P1. Select the providers you have worked with.

Provider 1
Provider 2
Provider 3
Provider 4
Provider 5
Provider 6
Provider 7
Provider 8
Provider 9
Provider 10
Provider 11
Provider 12
Provider 13
Provider 14
Provider 15
Provider 16

In P2. The providers that for the interviewee are the most important should be ranked, taking into account only the providers with whom they have worked. (Multiple entry question)

P2. What is the importance ranking of the suppliers you work with?Provider 1
Provider 2
Provider 3
Provider 4
Provider 5
Provider 6
Provider 7
Provider 8
Provider 9
Provider 10
Provider 11
Provider 12
Provider 13
Provider 14
Provider 15
Provider 16
So far everything is correct, however for the following questions I only have to take the first 3 providers according to the P2 ranking. but...
The provider that makes the evaluation is provider 4, so I am not interested in evaluating that provider if not its competition, so, if provider 4 is within the first three positions in the P2 ranking, I must take the supplier who is in position 4.

I hope my explanation has been clear.

How could I make this leap?

I thank everyone for any help or advice.

Greetings, :)
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 5 months ago - 2 years 5 months ago #221122 by Joffm
Replied by Joffm on topic exclude a variable by substitution
Hi,
you do it exactly as you explained it.
To store the result, you may create a hidden question of type "multiple short text" with three subquestions (QHidden).
Now ise an equation to fill these three places.
The first.
You know:
If "provider 2" is ranked first you have to take the second ranked.
{QHidden_1=if(P2_1==2,P2_2.shown,P2_1.shown)]

The second:
If "provider 2" is ranked first or second you have to take the third ranked else the second.
{QHidden_2=if(P2_1==2 or P2_2==2,P2_3.shown,P2_2.shown)}

And at last the third place
{QHidden_3=if(P2_1==2 or P2_2==2 or P2_3==2,P2_4.shown,P2_3.shown)}

You see that I always used numerical codes (easy, short)

1. The "forbidden" provider is one of the first three
 



2. The "forbidden" provider is NOT one of the first three
 



Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 years 5 months ago by Joffm.
The topic has been locked.
  • Fran1991
  • Fran1991's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 5 months ago #221124 by Fran1991
Replied by Fran1991 on topic exclude a variable by substitution
Hi joffm,

Thanks for your help.

I have a question, I forgot to mention that the following questions are on a 10 point scale.

P3. How likely are you to recommend vendor 1?

P4. How likely are you to recommend provider 2?

P5. How likely are you to recommend vendor 3?

So I did this for all 16 providers. and my idea was to show it with relevance.

So I don't know exactly how to filter the first 3 ranked in P2. not counting the supplier 4.

Thanks again.

I will try to do it as you mentioned before.

Thank you again for your help in finding the right path.

Greetings. :)
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 5 months ago #221125 by Joffm
Replied by Joffm on topic exclude a variable by substitution
No matter, what type the following questions are.
You have the three providers stored and may use them whereever and however you want.

JOffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Fran1991
The topic has been locked.
  • Fran1991
  • Fran1991's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 5 months ago #221126 by Fran1991
Replied by Fran1991 on topic exclude a variable by substitution
Thank you very much Joffm.

You help me a lot with your knowledge.

A hug .
The topic has been locked.
  • Fran1991
  • Fran1991's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 5 months ago #221155 by Fran1991
Replied by Fran1991 on topic exclude a variable by substitution
Hi joffm.

I hope you have a little patience for me.

I tell you that I have done some tests according to the equation that you have helped me to share, however, it has not been possible to register the providers as you put me in your example.

It will be that something is not executing well, or the problem will be something on my side.

I leave you an lss file with only the three questions so that the problem can be identified.

I am very grateful for your valuable help.

Greetings, :)
The topic has been locked.
  • Fran1991
  • Fran1991's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 5 months ago #221157 by Fran1991
Replied by Fran1991 on topic exclude a variable by substitution
Hi joffm,

I could not do it as in the example you share with me.

But if someone serves you ...

As I have each fixed provider, that is, each provider has its own variable, I was guided by Joffm's example and in each relevecian equation I used something like this.

if (P2_4.NAOK == 1 or P2_4.NAOK == 2 or P2_1.NAOK == 3, P2_1.NAOK == 1 or P2_1.NAOK == 2 or P2_1.NAOK == 3 or P2_1.NAOK == 4 , P2_1.NAOK == 1 or P2_1.NAOK == 2 or P2_1.NAOK == 3 or P2_5.NAOK == 4)

So if the supplier 4 is within the first three places, it will be replaced by the supplier to which we refer if it is in position 1,2,3, and 4.

Thank you joffm for your great help.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 5 months ago #221160 by Joffm
Replied by Joffm on topic exclude a variable by substitution
Hi,fran
1.

create a hidden question of type "multiple short text" with three subquestions (QHidden).
Now use an equation to fill these three places.

These are two questions, the multiple text AND an equation.
This equation is used to fill the text question

2. I wrote
{QHidden_1=if(P2_1==2,P2_2.shown,P2_1.shown)}

But you inserted
{QHidden_1==if(P2_1==2,P2_2.shown,P2_1.shown)}

One "=" sign assigns a value, but you tried to do a comparison "==".

 

File Attachment:

File Name: limesurvey...2892.lss
File Size:39 KB


Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose