Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rennesia
Contributor III
Contributor III

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?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

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

View solution in original post

7 Replies
Gysbert_Wassenaar

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
agustinbobba
Partner - Creator
Partner - Creator

Hi Automation,

Try use Outer Join.

CommonTable:

LOAD

     Timestamp,

     Temperatures

FROM Temperatures;

Outer Join(CommonTable)

LOAD

     Timestamp,

     Pressures

FROM Pressures;

Best regards!

Agustin

MarcoWedel

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

MarcoWedel

maybe like this:

QlikCommunity_Thread_210131_Pic1.JPG

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

rennesia
Contributor III
Contributor III
Author

Thanks Marco,

This is a good solution for my problem!

rennesia
Contributor III
Contributor III
Author

Thanks Gysbert for your solution, it works fine!

oknotsen
Master III
Master III

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 .

May you live in interesting times!