Skip to main content
Solved

Counter generate IDs

  • October 4, 2022
  • 14 replies
  • 225 views

Forum|alt.badge.img+5

I have one table where id already there now what I want is when I push the new data it will generate an automatic id

 

for example the Table ID is 47 and when I push new data then that table insert from 48 in ID columns

 

I use a counter to generate the ID from new data and then I use the static calculator from Table so it gives me a max number of 47 and when running that wS then it's not generate the ids

Best answer by carmijo

so how can i do that ??

  1. locate an attribute that's populated for all your features coming out of attributremanager_4
  2. add a sorter
  3. feed features from attributemanager_4 and statisticscalculator to the sorter
  4. setup the sorter to sort by the attribute that you picked in step 1, ascendingimage
  5. then the first feature to hit the counter will have the id.max attribute populated

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

14 replies

carmijo
Supporter
Forum|alt.badge.img+11
  • Supporter
  • 135 replies
  • October 4, 2022

Hi @asadamjad​ You can send the max value from the statistics calculator to the Count Start parameter of the Counter. That way the counter will start at the correct id value. To do this, you may need to add the max ID value to the data you want to add the ID to.

image--

If i've provided something helpful, please upvote the comment. If i've provided a solution, please mark it as 'Best Answer'. This helps the community find solutions when your question is referenced.

If I didn't provide a solution, please let me know if I can help further. Thanks! 🙂


Forum|alt.badge.img+5
  • Author
  • 170 replies
  • October 4, 2022

thats what i m doing still not working

 

image


Forum|alt.badge.img+5
  • Author
  • 170 replies
  • October 4, 2022

still rejecting

image


carmijo
Supporter
Forum|alt.badge.img+11
  • Supporter
  • 135 replies
  • October 4, 2022

still rejecting

image

I attached a screenshot with a better explanation. take a look and see if that helps.


Forum|alt.badge.img+5
  • Author
  • 170 replies
  • October 4, 2022

I attached a screenshot with a better explanation. take a look and see if that helps.

check my SS as well please


carmijo
Supporter
Forum|alt.badge.img+11
  • Supporter
  • 135 replies
  • October 4, 2022

I attached a screenshot with a better explanation. take a look and see if that helps.

I did but it's difficult to understand where the problem is since no parameter values are showing. i would recommend attaching a summary annotation to the primary transformers like the counter_3 and counter


Forum|alt.badge.img+5
  • Author
  • 170 replies
  • October 4, 2022

Please see the attached File


carmijo
Supporter
Forum|alt.badge.img+11
  • Supporter
  • 135 replies
  • October 4, 2022

Please see the attached File

from your workspace. see the tan colored annotation

image


Forum|alt.badge.img+5
  • Author
  • 170 replies
  • October 4, 2022

still not rejecting

 imageimage


Forum|alt.badge.img+5
  • Author
  • 170 replies
  • October 4, 2022

image


carmijo
Supporter
Forum|alt.badge.img+11
  • Supporter
  • 135 replies
  • October 4, 2022

image

I see. it's probably because the other features are getting to the counter before the feature from the statistics calculator. So it's trying to start counting but it doesn't know id.max at this point. you'll want to feed both streams into a sorter and sort in a way that the record with the id.max value enters the counter first


Forum|alt.badge.img+5
  • Author
  • 170 replies
  • October 4, 2022

so how can i do that ??


Forum|alt.badge.img+5
  • Author
  • 170 replies
  • October 4, 2022

still not

 

imageimage


carmijo
Supporter
Forum|alt.badge.img+11
  • Supporter
  • 135 replies
  • Best Answer
  • October 4, 2022

so how can i do that ??

  1. locate an attribute that's populated for all your features coming out of attributremanager_4
  2. add a sorter
  3. feed features from attributemanager_4 and statisticscalculator to the sorter
  4. setup the sorter to sort by the attribute that you picked in step 1, ascendingimage
  5. then the first feature to hit the counter will have the id.max attribute populated