question

Axel-4354 avatar image
0 Votes"
Axel-4354 asked Axel-4354 commented

How to cast a column in ADX

I have a Table with two columns, values_1 and values_2, which are float:s. Is there a command in adx to cast these to ints in a simple way or do I need to do:

Table
| extend values_1 = toint(value_1)
| extend values_2 = toint(value_2)

to get these as int:s?

azure-data-explorer
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @Axel-4354 ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .In case if you have any resolution please do share that same with the community as it can be helpful to others . Otherwise, will respond back with the more details and we will try to help .
Thanks
Himanshu

0 Votes 0 ·

Hello @Axel-4354 ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .In case if you have any resolution please do share that same with the community as it can be helpful to others . Otherwise, will respond back with the more details and we will try to help .
Thanks
Himanshu

0 Votes 0 ·
Axel-4354 avatar image Axel-4354 HimanshuSinha-MSFT ·

Hi, thank you for taking your time to help but the answer you provided was essentially what was written in my question, so did not provide any direct solution.
It is not really a problem, since I had a "solution" in my question, but more wondering how to write some things more neatly.

But the specific question is: is there a simple function to just cast a column in a table to int inplace without using extend, as in my example?

0 Votes 0 ·

1 Answer

HimanshuSinha-MSFT avatar image
0 Votes"
HimanshuSinha-MSFT answered PRADEEPCHEEKATLA-MSFT edited

Hello @Axel-4354,
Thanks for the ask and using Microsoft Q&A platform .
You can use toint()

AzureMetrics
| project Average,toint(Average)

134286-image.png

Please do let me know how it goes .
Thanks
Himanshu


  • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how

    • Want a reminder to come back and check responses? Here is how to subscribe to a notification

    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators


image.png (7.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.