Skip to main content
Solved

Counter generate IDs


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

asadamjad wrote:

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

 

View original
Did this help you find an answer to your question?

14 replies

carmijo
Supporter
Forum|alt.badge.img+11
  • Supporter
  • 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
  • October 4, 2022

thats what i m doing still not working

 

image


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

still rejecting

image


carmijo
Supporter
Forum|alt.badge.img+11
  • Supporter
  • October 4, 2022
asadamjad wrote:

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
  • October 4, 2022
carmijo wrote:

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
  • October 4, 2022
carmijo wrote:

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
  • October 4, 2022

Please see the attached File


carmijo
Supporter
Forum|alt.badge.img+11
  • Supporter
  • October 4, 2022
asadamjad wrote:

Please see the attached File

from your workspace. see the tan colored annotation

image


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

still not rejecting

 imageimage


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

image


carmijo
Supporter
Forum|alt.badge.img+11
  • Supporter
  • October 4, 2022
asadamjad wrote:

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
  • October 4, 2022

so how can i do that ??


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

still not

 

imageimage


carmijo
Supporter
Forum|alt.badge.img+11
  • Supporter
  • Best Answer
  • October 4, 2022
asadamjad wrote:

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

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings