There is a consumption Mismatch in Energy Consumption Tab. Please refer the Below mentioned Queries and give suggestions inorder to get the same values in all charts.
1.Query Binded for Total Energy :
select sum(Diff) from( SELECT top(30) cast(Date as date) as time, SUM(convert(float,KWH)) as kwh,min(convert(float,KWH)) as Minimum,max(convert(float,KWH)) as Maximum,(max(convert(float,KWH))-min(convert(float,KWH))) as Diff
from Main where BG =:bg and Plant =:pl and Line =:ll and Machine =:ma and Date between :st and :sp and KWH !='0'
GROUP BY cast(Date as date)
order by Diff desc) as d
Property Binding for Total Energy:
[
{
"type": "ia.display.label",
"version": 0,
"props": {
"style": {
"fontSize": 18,
"fontWeight": "bold",
"textAlign": "center"
}
},
"meta": {
"name": "Total Energy Value"
},
"position": {
"x": 297.123,
"y": 89.553,
"rotate": {
"anchor": "75% 50%"
},
"height": 32,
"width": 58
},
"custom": {},
"propConfig": {
"props.text": {
"binding": {
"type": "query",
"config": {
"returnFormat": "scalar",
"queryPath": "SumMonth",
"parameters": {
"ll": "{.../Line_Dropdown.props.value}",
"st": "{.../DateTimeInput.props.value}",
"ma": "{.../Machine_Dropdown.props.value}",
"bg": "{.../BG_Dropdown.props.value}",
"pl": "{.../Plant_Dropdown.props.value}",
"sp": "dateArithmetic({.../DateTimeInput.props.value}, 1, \"days\")"
}
},
"transforms": [
{
"formatType": "numeric",
"formatValue": "####.0",
"type": "format"
}
]
}
}
}
}
]
- Query Binded For Energy Gauge
Select (max(convert(float,KWH))-min(convert(float,KWH))) as Diff from Main WHERE BG =:bg and Plant =:pl and Line=:ll
and Machine = :ma and Mod_Date between :st and :sp
Property Binding for Energy Gauge:
[
{
"type": "ia.chart.simple-gauge",
"version": 0,
"props": {
"minValue": 1000,
"maxValue": 35000,
"startAngle": -90,
"arc": {
"color": "#808000"
},
"arcBackground": {
"color": "#D9D900"
},
"label": {
"visible": false
},
"animate": true,
"style": {
"classes": []
}
},
"meta": {
"name": "SimpleGauge"
},
"position": {
"basis": "300px"
},
"custom": {},
"propConfig": {
"props.value": {
"binding": {
"type": "query",
"config": {
"returnFormat": "scalar",
"queryPath": "Online_KWH",
"parameters": {
"ll": "{..../Line_Dropdown.props.value}",
"st": "{..../DateTimeInput.props.value}",
"ma": "{..../Machine_Dropdown.props.value}",
"bg": "{view.params.BG}",
"pl": "{view.params.Plant}",
"sp": "dateArithmetic({..../DateTimeInput.props.value},18,\"hours\")"
}
}
}
}
}
}
]
kindly suggest the required changes in the queries inorder to get the values in Total Energy as like Energy gauge