Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Has anyone tried to calculate MKT (Mean Kinetic Temperature) in Qlikview. I'm looking for a way to do the calculations in Qlikview but haven't had any luck.
What is your current expression?
I am currently using an excel function and then bringing in the data. However there is currently over 230,000 temperature data points and more added daily.
This is the macro I use in excel:
Function MKT(ByVal Temperatures As Variant) As Double
Dim Sum As Double
Dim TemperatureCount As Long
Dim GasConst As Double
Dim DeltaH As Double
Dim Conv As Double
Conv = 273.15
GasConst = 8.314472
DeltaH = 10 * GasConst
Sum = 0
For TemperatureCount = Temperatures.Cells.Count To 1 Step -1
Sum = Sum + Exp(-DeltaH / (GasConst * (Temperatures(TemperatureCount) + Conv)))
Next TemperatureCount
MKT = (DeltaH / GasConst) / (-Log(Sum / Temperatures.Cells.Count)) - Conv
End Function
How can I create this in Qlikview? I tried creating variables and calculating the variables but it doesn't work.
Ok, your time intervals are equal then.
Instead of the for loop, the QV way of doing this is to create a field in your data model that holds the temperature values T, then use QV aggregation functions (namely sum()) to automatically iterate over all values.
See attached for a sample.