Making a kwh report

Hi

i am wondering what would be the best way of making a kwh report in Ignition Reportig ?

I have come as fare as getting a report to give me a table with logged numbers bewteene two given dates.

Where im getting stuck are if i have historical data on a Kwh(total) counter and i want to report hourly consumption betweene given dates how would i do that ?

I have not used SQL language before to be fair.

somthing similar to

hour - kwh(total counter) - kwh(Consumption)
1 - 100
2 - 120 - 20
4 - 150 - 30
5 - 150 - 0

Ths may give you a start.

Thank you, it looks like this is exactly what i need.

Could you give me some pointers on how to implement/set it up in ignition ?

i have only used very basic scripting on components(buttons etc) in Ignition so fare

Make sure that you display 'kWh'. 'k' for kilo, 'W' for watt, as defined by SI. The hour isn't an SI unit so you can use your own preference for that but since 'H' is henries I'd avoid it. 'KWh' would be kelvin-watt-hours.
Capitals matter (as they do in your post, cough, cough).

You may also want to leverage the "intervalHours" parameter in the system.tag.queryTagHistory() function. Together with the "LastValue" or "Range" aggregate parameter, you can get either the running total of your counter or the difference between hours.