Welcome to the LimeSurvey Community Forum

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

How can I change a text column to numeric and add a "total" line?

  • akumasama
  • akumasama's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 11 months ago - 1 year 11 months ago #239979 by akumasama
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.15.5+ 181115
Own server or LimeSurvey hosting:
Survey theme/template:
==================
So I created a question with a custom array composed of 10 lines and 3 columns. First column has a predefined list of options available through a dropdown menu. Column 2 and 3 are text.

I want to do two changes to this question
1) change the type of column 2 and 3 from text to numerical (with maximum 2 decimals) 
2) add a line with a total sum of the values for column 2 and 3. The goal of this is to offer help to whomever is answering the question, so that they can easily check they didn't put wrong numbers by accident


Can anybody tell me if it's possible to do these things with LimeSurvey and, if so, how? 
Last edit: 1 year 11 months ago by akumasama.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago - 1 year 11 months ago #239981 by Joffm
Hi,
please neither provide lsq nor lsg exports, only lss.
Reason: lsq and lsg exports are language sensitive. 
You can't import them into a survey with a different base language.
So, to help you we have to create a new survey, guessing the base language of your export, create a new group to be able to import your lsq export.
Furthermore all surveywide settings are not included which also might be importeant.

Please, ease the life of us volunteers.

Joffm

I should say:
1. Validate the entries in column 2 and 3 with a regular expression.
2. You may add an additional "header" in the last row, where you display the sum using ExpressionScript

Only to show the inserted summary row:
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 11 months ago by Joffm.
The following user(s) said Thank You: akumasama

Please Log in to join the conversation.

  • akumasama
  • akumasama's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 11 months ago #239984 by akumasama
Hi Joffm, I apologize for the lsq. Here is the lss version but it's practically empty I'm simply testing out things for now. 
Thanks for any support! 
Attachments:

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #239998 by holch

Here is the lss version but it's practically empty

We don't even want complete surveys, just a LSS file with the relevant questions for the issue. we usually ask people to make a copy of their survey, delete everything that is not necessary for the problema at hand and then export it as LSS. The important part is that we do not have to create a survey to import the LSQ or LSG files into. If you have to do this a couple of times a day, it really adds up.

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 following user(s) said Thank You: akumasama

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #240001 by Joffm
Here is a solution with - as I said before - a regular expression
 

and a sum at the botton.
 
Done by combining two questions with css classes "no-question" and "no-bottom"

Working sample tomorrow.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: akumasama

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #240004 by Joffm
And please do not double post in different parts of the forum at the same time.
It is really annoying for us voluntary helpers to see that the question already was answered in the other part.
Meaning: one of us wasted his time.

You may ask in your mother tongue first to discuss without language gap.
Or you ask in the international (English) part, as most of us read and answer here, too.
​​​​
Joffm 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: akumasama

Please Log in to join the conversation.

  • akumasama
  • akumasama's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 11 months ago #240017 by akumasama
This is absolutely brilliant!
Can't wait to see the lss file so I can see and learn how you used regular expressions to obtain that ;-)

Once more please let me apologize for the mess I unintentionally created here with my unsightly behaviour.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #240023 by Joffm
Hi,
here the promised sample survey.
 

File Attachment:

File Name: limesurvey...1976.lss
File Size:36 KB


 

And regular expressions:
You learn them by visiting the several pages in the internet, like "regex101.com" and many many more.

Joffm

By the way:
You wrote that you use this old 3.15. version, that didn't get any updates and security fixes for more than two years.
But your database version seems to be from the 2.50/2.73 branch.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: akumasama

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose