Reputation: 1046
The below print statement always returns empty string. Why is it happening?
let tspanString=strcat(tostring(toint(rand(100))),'d');
print totimespan(tspanString)
Upvotes: 0
Views: 630
Reputation: 25895
the result of strcat(N, 'd')
is a non constant string in a format that can't be parsed into a timespan literal, when passed into totimespan()
.
A valid alternative in your case would be using rand(100) * 1d
See: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/datetime-timespan-arithmetic
Upvotes: 1