Solved

how we can limit the user for input value?

  • 19 July 2023
  • 9 replies
  • 339 views

Userlevel 4
Badge +6

Hi Community Members,

Please let me know how we can limit the user for input value.

Means, There is an input metric where user can provide input between 0.01 to 0.99 only.

icon

Best answer by Benoit 20 July 2023, 18:22

View original

9 replies

Userlevel 4
Badge +6

can we achieve it by security?

Userlevel 6
Badge +12

Hi Abhilash,

 

I can think of 3 things:

  • Inform users that they inputed a wrong value using conditional formating, ie: if value is >1, then format it in Red.
  • Create an automation for when the input value is over 1, it sends a notification with a specific message to selected users
  • Lock the value input using a dimension, for this workaround, I created a board explaining how it can work.

 

I created a dimension with my correct values, and I use a input dimension metric which will feed a result number metric for the rest of my calculations.

I have attached the full board in pdf with explanation here.

Please see file attached.

 

Hope it helps.

Best,

Benoit

 

Userlevel 4
Badge +6

Thanks @Benoit 

Will it impact the performance of pigment, if we achieve requirement by dimension?

Userlevel 6
Badge +12

Well, it’s still additionnal blocks but I don’t think there is a concrete impact on the calculations. Given the dimension is used for metric type with only with limited values for inputting and not as a metric structure.

The formula to convert the dimension to the number is pretty simple, a basic 'input dimension'.Value mapping, So it’ll be run quite fast and would remain unoticeable from an end user perspective.

Userlevel 4
Badge +6

Thanks @Benoit for your valuable reply.

Userlevel 3
Badge +5

Hi @abhilashsawla, one further approach that may supplement this would be to create a boolean metric to perform some validation logic, based on some condition. If you set the formula to produce a value of TRUE for a validation failure.

You can incorporate it as part of an EXCLUDE modifier to filter out the invalid values and produce a ‘sanitised’ metric for use in other formulas.

If you do this in conjunction with conditional formatting, you will be able to perform some fairly complex validation logic, and allow users to correct their mistakes without the invalid data impacting other calculations within your model.

Userlevel 4
Badge +6

Thanks @Mat 

Userlevel 3
Badge +5

Hi @abhilashsawla,

For further clarity, attached is a PDF export of my worked example in Pigment.

I hope this helps!

Userlevel 4
Badge +6

Thanks @Mat for attached pdf

Reply