Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI All,
I have a table in Which i m getting Number of Temperature Values.
i want to pick Last Record from that temperature field.
I am using Expression like that in a table
Table:
load
Field1,
Field2,
Temperature,
Peek(Temperature,-1,'Table') as CurrentTemperature
From Path..
But not getting the expected output.
Regards
Abhay
I would suggest this approach - with a normal link (association) so you get efficient storage and quick execution:
May be this:
Table:
load
Field1,
Field2,
Temperature,
FROM Source;
LastTemp:
LOAD LastValue(Temperature) as CurrentTemperature
Resident Table;
Hi Sunny,
Its not Working with multiple field...
How I will Link it to my Table.
Would you be able to share a sample with expected output?
I can Explain you
Table:
load
Asset,
Field2,
Temperature,
FROM Source;
This is kind of table i have and Assets has multiple temperature which is stored in Temperature Field
So I need to Pick Last Temperature as Current Temp of Asset.
Asset Temp
ABC -20
ABC -10
ABC -5
ABC 1
So Against ABC i Want 1 as Output.
Regards
Abhay
If you have multiple assets, try this:
Table:
LOAD Asset,
Temperature,
FROM Source;
Join (Table)
LOAD Asset,
LastValue(Temperature) as CurrentTemperature
Resident Table
Group By Asset;
See if this works:
Table:
LOAD * Inline [
Asset, Temp
ABC, -20
ABC, -10
ABC, -5
ABC, 1
DEF, -20
DEF, -10
DEF, -5
DEF, 10
];
Join (Table)
LOAD Asset,
LastValue(Temp) as CurrentTemp
Resident Table
Group By Asset;
I would suggest this approach - with a normal link (association) so you get efficient storage and quick execution:
Its working
Data:
LOAD FirstSortedValue(Temp,-RecNo()) as Lastvalue;
LOAD * Inline
[Asset,Temp
ABC,-20
ABC,-10
ABC,-5
ABC,1
];