Jump to content

Introducing Conversion Functions in KQL


Recommended Posts

Guest ShafMahmood
Posted

Are you working with unit measurement data and the data is one unit and you need it another unit?

 

 

 

There could be many reasons that you need to convert the value, whether this is due to regional requirements or to simplify for reporting.

 

 

 

Great news, the Kusto team have introduced several unit conversion functions to Azure Data Explorer that will help with this.

 

 

 

Below you will find the list of unit conversion functions that have been added along with examples.

 

 

 

convert_angle - Converts one angle unit to another.

 

 

 

Conversion units available for angles:

 

Arcminute, Arcsecond, Centiradian, Deciradian, Degree, Gradian, Microdegree, Microradian, Millidegree, Milliradian, Nanodegree, Nanoradian, NatoMil, Radian, Revolution, Tilt.

 

 

 

Example to convert from Degree to Arcminute:

 

 

 

mediumvv2px400.png.a51c91fb69053647132d95d7ce717984.png

 

 

 

convert_energy – Converts one energy unit to another.

 

 

 

Conversion units available for energy:

 

BritishThermalUnit, Calorie, DecathermEc, DecathermImperial, DecathermUs, ElectronVolt, Erg, FootPound, GigabritishThermalUnit, GigaelectronVolt, Gigajoule, GigawattDay, GigawattHour, HorsepowerHour, Joule, KilobritishThermalUnit, Kilocalorie, KiloelectronVolt, Kilojoule, KilowattDay, KilowattHour, MegabritishThermalUnit, Megacalorie, MegaelectronVolt, Megajoule, MegawattDay, MegawattHour, Millijoule, TeraelectronVolt, TerawattDay, TerawattHour, ThermEc, ThermImperial, ThermUs, WattDay, WattHour.

 

 

 

Example to convert from Joule to BritishThermalUnit:

 

 

 

mediumvv2px400.png.23db9f646b08f32de379f1b7787a34c4.png

 

 

 

convert_force – Converts one force unit into another.

 

 

 

Conversion units available for force:

 

Decanewton, Dyn, KilogramForce, Kilonewton, KiloPond, KilopoundForce, Meganewton, Micronewton, Millinewton, Newton, OunceForce, Poundal, PoundForce, ShortTonForce, TonneForce.

 

 

 

Example to convert from Newton to Decanewton:

 

 

 

mediumvv2px400.png.54559bad309c582542fb27bd5586f675.png

 

 

 

convert_length – Converts one length unit to another.

 

 

 

Conversion units available for length:

 

Angstrom, AstronomicalUnit, Centimeter, Chain, DataMile, Decameter, Decimeter, DtpPica, DtpPoint, Fathom, Foot, Hand, Hectometer, Inch, KilolightYear, Kilometer, Kiloparsec, LightYear, MegalightYear, Megaparsec, Meter, Microinch, Micrometer, Mil, Mile, Millimeter, Nanometer, NauticalMile, Parsec, PrinterPica, PrinterPoint, Shackle, SolarRadius, Twip, UsSurveyFoot, Yard.

 

 

 

Example to convert from Meter to Foot:

 

 

 

mediumvv2px400.png.c9f1ac5e0398bdc854507cb6bdaec7d2.png

 

 

 

convert_mass – Converts one mass unit into another.

 

 

 

Conversion units available for mass:

 

Centigram, Decagram, Decigram, EarthMass, Grain, Gram, Hectogram, Kilogram, Kilopound, Kilotonne, LongHundredweight, LongTon, Megapound, Megatonne, Microgram, Milligram, Nanogram, Ounce, Pound, ShortHundredweight, ShortTon, Slug, SolarMass, Stone, Tonne.

 

 

 

Example to convert from Kilogram to Pound:

 

 

 

mediumvv2px400.png.e64016c0bf567e6088a04b7985c70220.png

 

 

 

convert_speed - Convert a speed value from one unit to another.

 

 

 

Conversion units available for speed:

 

CentimeterPerHour, CentimeterPerMinute, CentimeterPerSecond, DecimeterPerMinute, DecimeterPerSecond, FootPerHour, FootPerMinute, FootPerSecond, InchPerHour, InchPerMinute, InchPerSecond, KilometerPerHour, KilometerPerMinute, KilometerPerSecond, Knot, MeterPerHour, MeterPerMinute, MeterPerSecond, MicrometerPerMinute, MicrometerPerSecond, MilePerHour, MillimeterPerHour, MillimeterPerMinute, MillimeterPerSecond, NanometerPerMinute, NanometerPerSecond, UsSurveyFootPerHour, UsSurveyFootPerMinute, UsSurveyFootPerSecond, YardPerHour, YardPerMinute, YardPerSecond.

 

 

 

Example to convert from MeterPerSecond to CentimeterPerHour:

 

 

 

mediumvv2px400.png.b9761a6df9196c46989265c50bfb4cc5.png

 

 

 

convert_temperature - Convert a temperature value from one unit to another.

 

 

 

Conversion units available for temperature:

 

DegreeCelsius, DegreeDelisle, DegreeFahrenheit, DegreeNewton, DegreeRankine, DegreeReaumur, DegreeRoemer, Kelvin, MillidegreeCelsius, SolarTemperature.

 

 

 

Example to convert from Kelvin to DegreeCelsius:

 

 

 

mediumvv2px400.png.469066a78609577470ba13736f037c0f.png

 

 

 

convert_volume - Convert a volume value from one unit to another.

 

 

 

Conversion units available for volume:

 

AcreFoot, AuTablespoon, BoardFoot, Centiliter, CubicCentimeter, CubicDecimeter, CubicFoot, CubicHectometer, CubicInch, CubicKilometer, CubicMeter, CubicMicrometer, CubicMile, CubicMillimeter, CubicYard, Decaliter, DecausGallon, Deciliter, DeciusGallon, HectocubicFoot, HectocubicMeter, Hectoliter, HectousGallon, ImperialBeerBarrel, ImperialGallon, ImperialOunce, ImperialPint, KilocubicFoot, KilocubicMeter, KiloimperialGallon, Kiloliter, KilousGallon, Liter, MegacubicFoot, MegaimperialGallon, Megaliter, MegausGallon, MetricCup, MetricTeaspoon, Microliter, Milliliter, OilBarrel, UkTablespoon, UsBeerBarrel, UsCustomaryCup, UsGallon, UsLegalCup, UsOunce, UsPint, UsQuart, UsTablespoon, UsTeaspoon.

 

 

 

Example to convert from CubicMeter to AcreFoot:

 

 

 

mediumvv2px400.png.e5b988ecf3f4b49ab58005037412c725.png

 

 

 

 

 

Please provide feedback if there are any additional conversion functions that you would find useful!

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...