Jump to content

Regarding converting user input in cell into a linear scale


Recommended Posts

Hello Nedyx community, 

I am trying to convert user input in between 40 to 90 into a linear scale of 0 to 1.

A user will give an input in a cell and it will vary in between for example 40 to 90.

And then, I want this value to be turned into a linear scale range of 0 to 1 and save it in a table which can be further used for radar matrix.

If the user gives input 40 it should be 0, if 65 then 0.50 and if if 90 then 1 and likewise.

Is there any function for it?

What can be the optimal way to implement this logic?

Thanks and regards,

Ashish.

 

Link to comment
Share on other sites

On 5/15/2024 at 10:27 AM, HaPe said:

Hi Ashish,

please find attached one example how such a linear scale could be realized in nedyx. Please let me know if you have any further questions. 

Hans Peter

nedyx_Linear Scale Demo.zip 1.89 kB · 1 download

Additional to above condition, I also want to add a rule for the cell that user cannot keep it empty and it has to be number and not a word. How can it be done?

Link to comment
Share on other sites

if only integer values maybe you could use a dropdown menu? You could implement a message when inserting a false value,

lets pretend cell2 is your input widget:

OnInput:

if(OR(len(NUMBER(#cell2))==0;#cell2<40;#cell2>90);
      MESSAGE("Error - only numbers between 40 and 90 allowed")
      #cell2=EMPTY()
      )

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
On 5/21/2024 at 10:56 AM, MountainMan said:

if only integer values maybe you could use a dropdown menu? You could implement a message when inserting a false value,

lets pretend cell2 is your input widget:

OnInput:

if(OR(len(NUMBER(#cell2))==0;#cell2<40;#cell2>90);
      MESSAGE("Error - only numbers between 40 and 90 allowed")
      #cell2=EMPTY()
      )

Hello, I am trying a similar solution. But, when the cell widget is empty the value of len(NUMBER(#cell2) comes out to be 1. I think, it considers value 0, when the cell is empty. Is it right? What can be the possible solution? PS : input Widget is cell widget.

Link to comment
Share on other sites

Hi, right, if a cell is empty, the NUMBER function returns 0. Then the LEN function converts the number 0 into a string, which is "0", and returns 1 as the length of this string. 

Instead, e.g. a formula like

IF(OR(ISEMPTY(#cell1); ... 

IF(OR(LEN(#cell1) == 0; ...

could be used instead. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...