Welcome to the LimeSurvey Community Forum

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

User participant attribute as number

  • s_cavalcanti
  • s_cavalcanti's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 3 months ago #212844 by s_cavalcanti
User participant attribute as number was created by s_cavalcanti
Hi,

At the municipal social services ​​department where I work we are using limesurvey to collect case numbers each NGO is dealing with every month.
We're giving each participant (a non-profit organization) an attribute_1 equal to the maximum number of cases they can insert monthly (at most, twice their capacity)

We're using the following formula to limit the number of cases inserted into Q1 as:

Q1.NAOK <= ((TOKEN:attribute_1 *2))

However It doesn't work because the attribute_1 is read as text instead of an integer/number.

Is there a way to set a certain attribute as numeric so we can use it the way I described?

Thanks in advance and apologies for the broken English
 
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
4 years 3 months ago - 4 years 3 months ago #212848 by DenisChenu
Replied by DenisChenu on topic User participant attribute as number
intval(trim(TOKEN:ATTRIBUTE_1)) ?

In general : only trim (excel have issue with hidden characters)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
Last edit: 4 years 3 months ago by DenisChenu.
The following user(s) said Thank You: s_cavalcanti
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 months ago #212849 by tpartner
Replied by tpartner on topic User participant attribute as number

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu, s_cavalcanti
The topic has been locked.
  • s_cavalcanti
  • s_cavalcanti's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 3 months ago #212865 by s_cavalcanti
Replied by s_cavalcanti on topic User participant attribute as number
It worked just fine. :)
Many thanks Denis and tpartner.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose