# How to calculate 2 msg.id coming from 2 pub different topics simulataneously

**URL:** <https://discourse.nodered.org/t/how-to-calculate-2-msg-id-coming-from-2-pub-different-topics-simulataneously/32730>\
**Category:** General\
**Created:** [11 September 2020 07:16 UTC](https://discourse.nodered.org/t/how-to-calculate-2-msg-id-coming-from-2-pub-different-topics-simulataneously/32730 "2020-09-11T07:16:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [11 September 2020 07:33 UTC](https://discourse.nodered.org/t/how-to-calculate-2-msg-id-coming-from-2-pub-different-topics-simulataneously/32730/2 "2020-09-11T07:33:31Z")

</div>

Hi @shipra

before you can compare the two values you'll need to get them into a single message.

There is a recipe for joining separate streams of messages together in the cookbook - [https://cookbook.nodered.org/basic/join-streams](https://cookbook.nodered.org/basic/join-streams)

That recipe shows how to join separate messages together, but it does assume the value you want to combine is in `msg.payload`. So you may need to use a Change node to move the value of `msg.id` to `msg.payload` before passing to the Join node.

---

_[View the full topic](https://discourse.nodered.org/t/how-to-calculate-2-msg-id-coming-from-2-pub-different-topics-simulataneously/32730)._
