Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
maxLevel2
typeflat

...

How does it work in the search window?

Select Create column in the search window toolbar, then select the To Float operation. You need to specify one argument:

Argument

Data type

String to convert / Integer to convert / Json to convert mandatory

string, integer, json

The data type of the values in the new column is float.

Example 1

In the demosiem.logtrust.ecommerceweb.dataactivity table, we want to transform the values in our bytesTransferred column (integer) into float format. To do it, we will create a new column using the To Float operation.

...

  • jq -  Click the pencil icon and enter .float

  • json - json column

...

Step 3: Transform the float values into float data type

...

  • float(number_string)

  • float(integer)

  • float(json_float)

Example 1

You can copy the following LINQ script and try the first example explained above on the demosiem.logtrust.ecommerceweb.dataactivity table. 

Code Block
from demosiem.logtrust.ecommerceweb.dataactivity
  select float(bytesTransferred) as bytestransferred_Float

Example 2

You can copy the following LINQ script and try the second example explained above on the demosiem.logtrust.ecommerceweb.dataactivity table. 

Code Block
from demosiem.logtrust.ecommerceweb.dataactivity
select jsonparse("{\"str\": \"hello\", \"int\": 1, \"float\": 2.5, \"boolean\": true, \"array\": [1,2,3], \"object\": {\"a\": 5}}") as json,
jqeval(jqcompile(".float"), json) as jsonFloat,
float(jsonFloat) as float