ashishkhadsare Posted May 14 Share Posted May 14 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. Quote Link to comment Share on other sites More sharing options...
HaPe Posted May 15 Share Posted May 15 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 Quote Link to comment Share on other sites More sharing options...
HaPe Posted May 15 Share Posted May 15 1 Quote Link to comment Share on other sites More sharing options...
ashishkhadsare Posted May 15 Author Share Posted May 15 Thanks for your valuable inputs!It worked!!😀 1 Quote Link to comment Share on other sites More sharing options...
ashishkhadsare Posted May 17 Author Share Posted May 17 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? Quote Link to comment Share on other sites More sharing options...
MountainMan Posted May 21 Share Posted May 21 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() ) 1 Quote Link to comment Share on other sites More sharing options...
ashishkhadsare Posted June 3 Author Share Posted June 3 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. Quote Link to comment Share on other sites More sharing options...
HaPe Posted June 4 Share Posted June 4 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.