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

More
10 years 1 day ago #124541 by holch
Expression Manager exists since 1.96 or something, so I don't see why it shouldn't work for you.

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.
The topic has been locked.
More
10 years 1 day ago #124542 by Thomassie
My bad.

I read this yesterday "Depends on the version you use. Since 2.06 you can use the Expression Manager to hide subquestions/answer options" and I interpreted that expression Manager was only integrated from 2.06, but it probably referred to the hide options.


I have something to work with now. Time to tinker.


thanks !!
The topic has been locked.
More
10 years 1 day ago #124544 by holch
Yes, this refers to the option to use relevance equations for subquestions. Before this was only possible for questions.

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.
The topic has been locked.
More
10 years 1 day ago #124545 by Thomassie
Alas
I cannot use text in the Assessmentbox :(
The topic has been locked.
More
10 years 1 day ago #124549 by holch
This is what I feared. There would be the option to create a second question (hidden) with the same list of respondents (same code) but without the Last name. Then a expression that answers the question based on the reponse to the previous question (which is answered by the respondent). I saw some expression from Jelo showing how to do this. Based on this you can read out the second question instead of the first and you'll only get the first name.

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.
The topic has been locked.
More
10 years 7 hours ago #124603 by jelo
@holch: Which expression?
Limesurvey is missing such list functions.

If I got it right, the list of persons is known upfront. And one person is choosen from a drop down list.
This person has a Name surname etc. But from the choosen person the first name (or any other personal name) shoud be used in other questions about that person?

If that is the case, why no use one equation with nested ifs? You use the answercodes of your dropdown question and assign the first name to the equation. Then you use the equation variable in your questions.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
More
10 years 7 hours ago - 10 years 7 hours ago #124605 by holch
@Jelo: Of course, using an expression with nested ifs would do the trick. But depending on the length of the list, these nested ifs could get quite tedious.

I was thinking to fill a normal single choice question, with just the same list of people as the dropdown, using the same answer codes, but instead of "firstname lastname" I would just display firstname as answer text. the list of names and answer codes could be easily be prepared in Excel and then copied in the quick add feature, which could cope even with longer lists. The second, single choice question would be hidden and via javascript or EM the same answer as for the first dropdown question would be marked in this question and thus you should be able to draw the first name from there.

Just an idea.

But seems like Tony already delivered a function that could solve the problem quite easily (in another thread of the OP).

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.
Last edit: 10 years 7 hours ago by holch.
The topic has been locked.
More
10 years 6 hours ago #124611 by Thomassie
@Jelo
@ Holch
Guys,


sorry to bother you, but the explanation of Tony is not so easy to comprehend for me (This is the first time I work with limesurvey or any survey alltogether, and I am working with the dutch version of limesurvey).

This is what Tony wrote:

You can use the stristr function to return the value of a selected item up to the first space.

{stristr(q1.shown, ' ', 'true')}


Could you explain this any further or maybe show me with an example ? or further explain jelo's explanation which is easier to comprehend but I have no experience with the equation's and little experience with html


thanks in advance !
The topic has been locked.
More
10 years 6 hours ago #124613 by holch
From what I understand is this function strips everything from a string after the first space. So actually exactly what you need.

Let's assume your answer texts with the names shows "Thomas Thomasson" as the full name of the person, which is your case in the dropdown, right? Lets assume the question code of this dropdown question for the name is "Q1". Then you could show the name chosen in Q1 by using {Q1.shown}. However, this would show "Thomas Thomasson", but you want just the first name "Thomas".

So the Expression Tony was showing, should take "Thomas Thomasson", read the string up to the first space and then write it out, which in this case would result in "Thomas".

Give it a try.

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.
The topic has been locked.
More
10 years 6 hours ago #124615 by jelo

holch wrote: But depending on the length of the list, these nested ifs could get quite tedious.

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.

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.
More
10 years 6 hours ago #124618 by jelo

Thomassie wrote: {stristr(q1.shown, ' ', 'true')}


Take a look at what the Equation Question Type is all about
www.limesurvey.org/manual/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.
More
10 years 6 hours ago #124619 by holch
Because the arrayfilter doesn't automatically mark the question? ;-)

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.
The topic has been locked.
More
10 years 6 hours ago #124620 by holch
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)...

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.
The topic has been locked.
More
10 years 5 hours ago #124621 by Thomassie
Thanks guys i'll give it a try. But it wont be till monday.

Your help was much appreciated !!
The topic has been locked.
More
10 years 5 hours ago - 10 years 5 hours ago #124622 by holch
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.

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.
Last edit: 10 years 5 hours ago by holch.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose