Breaking my head over the following:
I have a persistent data table.
this code:
Code: Select all
print('Today item 01 = '..dz.data.TMPTODAY.get(1).data[1]..', '..dz.data.TMPTODAY.get(1).data[2])
print('Today item 48 = '..dz.data.TMPTODAY.get(48).data[1]..','..dz.data.TMPTODAY.get(48).data[2])
print('Today item 96 = '..dz.data.TMPTODAY.get(96).data[1]..','..dz.data.TMPTODAY.get(96).data[2])
Provides this output:
Today item 01 = 2025-10-05 00:00:00, 0.1477
Today item 48 = 2025-10-05 11:45:00, 0.1452
Today item 96 = 2025-10-05 23:45:00, 0.152
From this list I only want to filter future data (or filter out previous data per now). I tried..
Code: Select all
local MyVar = dz.data.TMPTODAY
local VanafNu = MyVar.filter(function (item)
return (dz.time.dateToDate(item.data[1], 'yyyy-mm-dd hh:MM:ss', 'yyyy-mm-dd hh:MM:ss', 0) >= dz.time.rawDateTime)
end)I tried (new line after 'end)')
print('TEST OUTPUT = '..VanafNu)
print('TEST OUTPUT = '..VanafNu[1])
but all I get is
lua:214: attempt to concatenate a table value (local 'VanafNu')
lua:214: attempt to concatenate a nil value (field '?')
How to access the filtered data?