'extend' operator: Failed to resolve scalar expression named 'd'

Viewed 28

I'm struggling with the following problem in KQL,

let a = 1;
let b = 2;
let c = DeviceInfo
| take 3
| count
| project-rename c=Count;
let d = DeviceInfo
| take 4
| count
| project-rename d=Count;
c | extend a,b

This produce the following result

| c | a | b |
-------------
| 3 | 1 | 2 |

By changing the last line, I'm able to get a,b,d but I'm unable to get a,b,c,d in the same table. I get the

'extend' operator: Failed to resolve scalar expression named 'd'

Any clues ? How can we use multiples let variable who come from results in a single table ?

1 Answers

try this simplified and clearer version, using toscalar():

let a = 1;
let b = 2;
let c = toscalar(
    DeviceInfo
    | take 3
    | count
);
let d = toscalar(
    DeviceInfo
    | take 4
    | count
);
print a, b, d, c
Related