- Posts: 5070
- Thank you received: 1263
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
create a cellreference or macro like in excel
- jelo
- Offline
- Platinum Member
Less
More
8 years 6 months ago #124615
by jelo
You meant the em-code to set a hidden question, which I stated in the quota thread?
That would mean the equation has to look like this "question2code=answercodeofquestion1"
Why was arrayfilter no option?
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic create a cellreference or macro like in excel
The Limesurvey user likes it tedious. The demand for more functions in EM seems to be low. I wonder if a function was added since TMSWhite left the show.holch wrote: But depending on the length of the list, these nested ifs could get quite tedious.
You meant the em-code to set a hidden question, which I stated in the quota thread?
That would mean the equation has to look like this "question2code=answercodeofquestion1"
Why was arrayfilter no option?
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
8 years 6 months ago #124618
by jelo
Take a look at what the Equation Question Type is all about
manual.limesurvey.org/Question_type_-_Equation
Next you create a Equation Question after your Name drop down selection question. You name the question e.g "fstname"
You put {stristr(q1.shown, ' ', 'true')} in the question text of the Equation question. But switch the editor to the source mode when you paste "{stristr(q1.shown, ' ', 'true')}".
The q1 has to be changed to the questioncode of your Name drop down selection question.
When now a proband selects a name the equation question will extract all characters till the first space.
Now you can insert {fstname} in questiontexts to get the choosen first name displayed.
Tonys method only works if no firstnames are containing a space.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic create a cellreference or macro like in excel
Thomassie wrote: {stristr(q1.shown, ' ', 'true')}
Take a look at what the Equation Question Type is all about
manual.limesurvey.org/Question_type_-_Equation
Next you create a Equation Question after your Name drop down selection question. You name the question e.g "fstname"
You put {stristr(q1.shown, ' ', 'true')} in the question text of the Equation question. But switch the editor to the source mode when you paste "{stristr(q1.shown, ' ', 'true')}".
The q1 has to be changed to the questioncode of your Name drop down selection question.
When now a proband selects a name the equation question will extract all characters till the first space.
Now you can insert {fstname} in questiontexts to get the choosen first name displayed.
Tonys method only works if no firstnames are containing a space.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
8 years 6 months ago #124619
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic create a cellreference or macro like in excel
Because the arrayfilter doesn't automatically mark the question?
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
8 years 6 months ago #124620
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic create a cellreference or macro like in excel
Yes, forgot to mention that this works only if the first space is between first name and last name, thank you Jelo for pointing this out.
One question: Shouldn't that expression work directly in the question code already, so you could skip the additional equation question?
I think I will make a little test.
"The Limesurvey user likes it tedious." Don't be so sarcastic.
I actually think we need some kind of expression manager for creating reports. Something like questioncode.mean, questioncode.max, questioncode.min, questioncode.median (also for subquestions). That would allow to create great custom reports. Then there would have to be a section of Limesurvey where you can provide those custom reports/dashboards to the client, with nice graphics (plenty of them out there)...
One question: Shouldn't that expression work directly in the question code already, so you could skip the additional equation question?
I think I will make a little test.
"The Limesurvey user likes it tedious." Don't be so sarcastic.
I actually think we need some kind of expression manager for creating reports. Something like questioncode.mean, questioncode.max, questioncode.min, questioncode.median (also for subquestions). That would allow to create great custom reports. Then there would have to be a section of Limesurvey where you can provide those custom reports/dashboards to the client, with nice graphics (plenty of them out there)...
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- Thomassie
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 45
- Thank you received: 0
8 years 6 months ago #124621
by Thomassie
Replied by Thomassie on topic create a cellreference or macro like in excel
Thanks guys i'll give it a try. But it wont be till monday.
Your help was much appreciated !!
Your help was much appreciated !!
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
8 years 6 months ago - 8 years 6 months ago #124622
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic create a cellreference or macro like in excel
Gave it a try, works like a charm. Doesn't require the step of the equation question. But if you use the string a lot, it probably makes sense to go for the equation question, because EM doesn't have to process the expression each time. But then, I guess it is not too heavy of a function and I am not sure if there is much difference in performance between calling {stristr(q1.shown, ' ', 'true')} or {fstname}.
One thing: if you use it directly, and the name question hasn't been answered yet (e.g. because they are on the same page), then you get a 'false' instead of the name.
One thing: if you use it directly, and the name question hasn't been answered yet (e.g. because they are on the same page), then you get a 'false' instead of the name.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Last edit: 8 years 6 months ago by holch.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
8 years 6 months ago #124624
by jelo
It also helps for debugging. If you made a mistake you don't need to change it in every questionstext. Just at one place.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic create a cellreference or macro like in excel
The extra steps saves the displayed value inside the results. If there is a bug or a problem, you always know what was choosen by the routine.holch wrote: Doesn't require the step of the equation question.
It also helps for debugging. If you made a mistake you don't need to change it in every questionstext. Just at one place.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: holch
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
8 years 6 months ago #124625
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic create a cellreference or macro like in excel
@Jelo: Makes sense. Good advice, especially for debugging just in one place, not in the whole survey.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- Thomassie
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 45
- Thank you received: 0
8 years 6 months ago #125655
by Thomassie
Replied by Thomassie on topic create a cellreference or macro like in excel
Hello,
with a slight delay (became father last week) I could try it and indeed, it works perfect. Thanks a million.
[SOLVED]
with a slight delay (became father last week) I could try it and indeed, it works perfect. Thanks a million.
[SOLVED]
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
8 years 6 months ago #125672
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic create a cellreference or macro like in excel
Well congratulations on both then: the baby and the working example...
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.