Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone, I need your help to spread the values that are part of a range of dates, to daily values.
Enclosed is an example of what I'd need.
my data source is a single file QVD with the fields as in the Excel.
To consider that my total assets are about 450.
Thanks to those who can help me
I solved by adding a where clause after the first load:
Table:
LOAD asset,
Date(Floor(data)) as date,
delta
FROM
(ooxml, embedded labels, table is Sheet1)
WHERE(delta <> '0');
in this way the calculation is performed without considering the deltas equal to zero.
It remains a small problem for the first readings of each asset which are also zero but should be considered (min (dates) group by assets)
What is the issue?
It remains a small problem for the first readings of each asset which are also zero but should be considered (min (dates) group by assets)
Try this:
Table:
LOAD asset,
Date(Floor(data)) as date,
delta
FROM
[targhe2.xlsx]
(ooxml, embedded labels, table is Sheet1);
tmpTable:
LOAD *
Where Not(delta = 0 and Flag > 1);
LOAD *,
AutoNumber(RecNo(), asset) as Flag,
Date(If(asset = previous(asset), Peek('date') + 1, date)) as startdate
Resident Table
Order By asset, date;
FinalTable:
LOAD Date(startdate + IterNo() - 1) as date,
delta/(date - startdate + 1) as value,
asset
Resident tmpTable
While startdate + IterNo()-1 <= date;
DROP Tables Table, tmpTable;
you were really nice and helpful.
Sorry if I was not very precise in directions
No worries