简体   繁体   English

Azure流分析查询

[英]Azure streaming analytics query

I have the following query that takes an input from an IoT weather station and outputs to Power Bi: 我有以下查询,它从IoT气象站获取输入并输出到Power Bi:

WITH machinelearning AS (
   SELECT EventEnqueuedUtcTime, Temperature, Humidity, WindSpeed, WindGust, Pressure, Rain, machinelearning(Temperature, Humidity, Pressure) as result from [CwrtCelynWeather]
)
Select WindSpeed, WindGust, CAST (result.[Pressure] AS FLOAT) AS Pressure, Rain, System.Timestamp time, CAST (result.[temperature] AS FLOAT) AS temperature, CAST (result.[humidity] AS FLOAT) AS humidity, CAST (result.[Scored Probabilities] AS FLOAT ) AS 'probabalities of rain'
Into [weatherPBi2]
From machinelearning

My question is how would i convert the following to a percentage? 我的问题是如何将以下内容转换为百分比?

CAST (result.[Scored Probabilities] AS FLOAT ) AS 'probabalities of rain'

At the moment it returns a decimal of 0.45, but i want to have it send 45.0. 目前它返回一个十进制的0.45,但我想让它发送45.0。 I have tried the following: 我尝试了以下方法:

CAST (result.[Scored Probabilities] AS FLOAT ) *100 AS 'probabalities of rain'

&

CAST (result.[Scored Probabilities*100] AS FLOAT ) AS 'probabalities of rain'

But the streaming analytics complains. 但是流分析抱怨。

Any help would be appreciated 任何帮助,将不胜感激

Thanks 谢谢

Kevin 凯文

Just in case anybody else runs into the same problem, here is my solution: 万一其他人遇到相同的问题,这是我的解决方案:

100 * CAST (result.[Scored Probabilities] AS FLOAT ) AS 'probabalities of rain'

This worked fine. 这很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM