# Generate primary key

**URL:** <https://forum.cloverdx.com/t/generate-primary-key/1582>\
**Category:** CloverDX Platform\
**Created:** [February 18, 2015, 12:00am UTC](https://forum.cloverdx.com/t/generate-primary-key/1582 "2015-02-18T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielbolt](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@danielbolt](https://forum.cloverdx.com/u/danielbolt)\
**Post date:** [February 18, 2015, 12:00am UTC](https://forum.cloverdx.com/t/generate-primary-key/1582/1 "2015-02-18T00:00:00Z")

</div>

Hi,

I’ve builded a graph. Please check the screenshot at the attachment.

Do CloverETL have a function that assigns a primary key to each row? I want to assig the primary key after the join presentated.

[CloverETL\_graph\_1.png](https://cdn.cloverdx.com/forum/17995%5F459a530b9f7b74285ead4ac8ef28d74b/CloverETL%5Fgraph%5F1.png)

Regards,

Daniël

- [CloverETL\_graph\_1.png](https://cdn.cloverdx.com/forum/17995%5F459a530b9f7b74285ead4ac8ef28d74b/CloverETL%5Fgraph%5F1.png)

---

<div class="post-metadata">

**Author:** ![imriskal](https://avatars.discourse-cdn.com/v4/letter/i/b38774/32.png) [@imriskal](https://forum.cloverdx.com/u/imriskal)\
**Post date:** [February 20, 2015, 2:14pm UTC](https://forum.cloverdx.com/t/generate-primary-key/1582/2 "2015-02-20T14:14:35Z")

</div>

Hi Daniel,

If the records were flowing from a reader component, you could use [autofilling functions](http://doc.cloveretl.com/documentation/UserGuide/topic/com.cloveretl.gui.docs/docs/autofilling.html). However, this is not the case. The other option you have is to create a global variable in the last Reformat before the Trash. You could count your records there and send the current value to the output with every record processed.
