How to safe incoming messages in a history! #2

Create history tables in dependence of a parameter:

In the post How to save incoming messages in a history! I already showed an example on how to safe incoming data in a dynamic history.
This approach works fine, if the message structure of different sources is always different, or we use different Inboxes to work with different sources. But how do we deal with the same kind of message structure belonging to two or more sources?

An example:

image

The inbox is getting “temperature” information from different machines. Creating a “temperature” history is now dependent on the “Machine ID”. Only if e.g. the “Machine ID” equals 1 a “temperature” entry is added to the “Temperature M1” table. We can do this by using the IF() function.

Using the same concept as in a simple history, but adding an IF() function for every cell.

Only when the “Machine ID” equals 1 give me the “temperature” value, if not stay the same:

=IF(B5=1,B6,D26)

As you can see this can be a lot of work, which is also why I use the “$” sign reference type to speed the process up.

Histories can also be created horizontally. As you maybe remember, from the first How to save incoming messages in a history! post, a Streamsheet is calculated from the top left (A1) to the right and from top to bottom. So the same principle used in a vertical history table can also be used horizontally.
This allows for another more convenient way by using the IF() cell.

IF30 declares, that only when B5=1 the 30th row is calculated.

Timeaggregate:

The same principle can be applied to the TIMEAGGREGATE() function. Either with the IF() function or the IF() cell the same outcome can be achieved.

=IF(B5=1,TIMEAGGREGATE(B6),FALSE)

=B5=1 ; =TIMEAGGREGATE(B6)