How to cast a column in ADX

Axel 1 Reputation point
2021-09-22T11:15:03.74+00:00

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
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
502 questions
{count} votes

1 answer

Sort by: Most helpful
  1. HimanshuSinha-msft 19,376 Reputation points Microsoft Employee
    2021-09-22T19:37:05.52+00:00

    Hello @Axel ,
    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
    0 comments No comments