简体   繁体   中英

How to call tabular function inside the for loop

I have one table with 3 columns.

  1. id
  2. start
  3. end

I am applying one function on table, function with 3 arguments.

Ex:Function1(id,start,end)

This function is working when I pass static value to it.but I want to run this function on full table.

How to do this?

This my use case Actually

datatable(id:string, start:string,end:string)
[
   'Z213',datetime(2021-08-06T02:12:37.1597030Z),datetime(2021-08-06T17:37:21.8962890Z),
  'Z213',datetime(2021-08-06T00:00:25.7896310Z),datetime(2021-08-06T01:59:50.1172850Z),
  'Z213',datetime(2021-08-06T02:04:37.1243340Z),datetime(2021-08-06T02:12:37.1352020Z),
  'Z213',datetime(2021-08-06T17:45:19.7289570Z),datetime(2021-08-06T23:56:44.8047730Z),
  'Z213',datetime(2021-08-06T17:43:23.7238020Z),datetime(2021-08-06T17:43:28.7256000Z),
  'Z213',datetime(2021-08-06T02:04:17.1238770Z),datetime(2021-08-06T02:04:24.1256730Z),
  'Z213',datetime(2021-08-06T02:02:15.1199760Z),datetime(2021-08-06T02:02:15.1204780Z),
]
|invoke function1('Z213',datetime(2021-08-06T02:12:37.1597030Z),datetime(2021-08-06T17:37:21.8962890Z))

So when I pass this 1st row then it will work fine.

but I want do this like

|invoke Function (id,start,end)

Take a look at the tabular functions here is an example:

let append_to_column_a=(T:(a:string), what:string) {
    T | extend a=strcat(a, " ", what)
};
datatable (a:string) ["sad", "really", "sad"]
| invoke append_to_column_a(":-)")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM