

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Generate unknown data
There are two tables with process data measured at different time stamps. I have to make a combined table where for all time stamps data must be present. See table below: the Common table is the 'combined table'. The bold values are the real registered one.
Is there an easy way to realize this?
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Temp:
LOAD Timestamp, Temperatures FROM ...;
Concatenate(Temp)
LOAD Timestamp, Pressures FROM ...;
Result:
Noconcatenate
LOAD
Timestamp,
Alt(Temperature,peek(Temperature)) as Temperature,
Alt(Pressure, peek(Pressure)) as Pressure
Resident Temp
Order By Timestamp
;
Drop Table Temp;
talk is cheap, supply exceeds demand

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Temp:
LOAD Timestamp, Temperatures FROM ...;
Concatenate(Temp)
LOAD Timestamp, Pressures FROM ...;
Result:
Noconcatenate
LOAD
Timestamp,
Alt(Temperature,peek(Temperature)) as Temperature,
Alt(Pressure, peek(Pressure)) as Pressure
Resident Temp
Order By Timestamp
;
Drop Table Temp;
talk is cheap, supply exceeds demand


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Automation,
Try use Outer Join.
CommonTable:
LOAD
Timestamp,
Temperatures
FROM Temperatures;
Outer Join(CommonTable)
LOAD
Timestamp,
Pressures
FROM Pressures;
Best regards!
Agustin


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
maybe using a join rather than concatenating the source tables to avoid double rows in case some temperature and pressure values are logged using the same timestamp.
regards
Marco


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
maybe like this:
tabProcessDataTemp:
LOAD * Inline [
Timestamp, Temperature
11:45:00, 45
11:55:00, 47
12:05:00, 49
12:10:00, 48
12:15:00, 46
];
Outer Join (tabProcessDataTemp)
LOAD * Inline [
Timestamp, Pressure
11:46:00, 4.56
11:58:00, 5.32
12:10:00, 4.36
12:22:00, 3.85
];
NoConcatenate
tabProcessData:
LOAD Timestamp,
If(Temperature,Temperature,RangeSum(Peek(Temperature),0)) as Temperature,
If(Pressure,Pressure,RangeSum(Peek(Pressure),0)) as Pressure
Resident tabProcessDataTemp
Order By Timestamp;
Drop Table tabProcessDataTemp;
hope this helps
regards
Marco


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Marco,
This is a good solution for my problem!


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Gysbert for your solution, it works fine!


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If your problem is now solved, please flag the correct answer with Correct Answer.
If not, please make clear what part of this topic you still need help with .
