Fred59
(Fred)
September 25, 2020, 1:39pm
1
Hello,
I have a field in string, and in this field, i have different numbers (example : 0032345643).
I want to add "0" at the beginning when the number have only 9 characters, and add "00" at the beginning when the number have only 8 characters.
It's possible in dev tools ?
have you an example of script for that ?
Thanks !
Dzmitry
September 25, 2020, 6:00pm
2
Hi @Fred59 ,
It is possible by transforming data with scripted fields :
Your script may look like
doc['your_field'].value.toString().length() == 9 ? "0"+doc['your_field'].value : "00"+doc['your_field'].value
Regards, Dzmitry
Fred59
(Fred)
September 26, 2020, 7:10pm
3
hello
perfect, thank, i will try that monday at work
Fred59
(Fred)
September 28, 2020, 12:56pm
4
Hello,
Possible to make this modification in dev tools for modifi the actual field et don't create a new field by scripted field ?
Because many visualisations use actually this field.
Fred59
(Fred)
October 5, 2020, 8:54am
6
Up please, i don't find anything
system
(system)
Closed
November 2, 2020, 8:55am
7
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.