I have the following data sample:
let data = datatable(Name:string, Value:string)
[
"Device_1", "60.12.12 %",
"Device_2", "40.12.12 %",
"Device_3", "50.12.12 %",
"Device_4", "48.33.33 %"
];
As you can see in the Value column, the values after the decimal points are duplicated.
How can we trim the second decimal point and the values after it ?
Expected result:
>Solution :
let data = datatable(Name:string, Value:string)
[
"Device_1", "60.12.12 %",
"Device_2", "40.12.12 %",
"Device_3", "50.12.12 %",
"Device_4", "48.33.33 %"
];
data
| parse kind=regex Value with Percent:real
| Name | Value | Percent |
|---|---|---|
| Device_1 | 60.12.12 % | 60.12 |
| Device_2 | 40.12.12 % | 40.12 |
| Device_3 | 50.12.12 % | 50.12 |
| Device_4 | 48.33.33 % | 48.33 |
