Skip to main content
Question

Counter Confussion

  • November 15, 2016
  • 10 replies
  • 29 views

Forum|alt.badge.img

I am trying to get a count based on two columns (Employee Number and Work Date).

I have this:

I want is this:

I have looked at counter, statistics calculator and sorter as well as looking at other post about these three here and I just can't get my head wrapped around this yet. Any help is much appreciated.

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.

10 replies

erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • November 15, 2016

I suggest the following:

Do a DuplicateFilter, based on EmployeeNumber and Working Date.

Use a Counter, where the counter name is a concatenation of EmployeeNumber and Working Date.

That will generate the right sequence.

Then Use the FeatureMerger with the original data (including duplicates) as Requester and the result of the Counter as Supplier (Join on the two first columns) adding the sequence number.

That should get you the required output.


david_r
Celebrity
  • November 15, 2016

Try the Aggregator:

 


Forum|alt.badge.img
  • Author
  • November 15, 2016

Try the Aggregator:

 

@david_r @daleatsafe

 

Here are my settings:

 

 

 

Here are the results: (Not exactly what I was expecting)

 

 

 

I am looking for this:

 

Emp. ID Date Count

 

1 20161017 1

 

1 20161017 1

 

1 20161018 2

 

1 20161019 3

 

1 20161019 3

 

2 20161017 1

 

2 20161018 2

 

2 20161019 3

 

I do not want to drop records or lose records. There are other attributes (Hours, Pay, Acct No, etc.) that are not shown.

Forum|alt.badge.img
  • Author
  • November 15, 2016

I suggest the following:

Do a DuplicateFilter, based on EmployeeNumber and Working Date.

Use a Counter, where the counter name is a concatenation of EmployeeNumber and Working Date.

That will generate the right sequence.

Then Use the FeatureMerger with the original data (including duplicates) as Requester and the result of the Counter as Supplier (Join on the two first columns) adding the sequence number.

That should get you the required output.

@erik_jan Here are the settings I used:

 

Here are the results:

 

Here is what I need:

 

Employee NumberWork DateCount4425410/18/201624425410/18/201624425410/19/201634425410/20/201644425410/21/201654425410/22/201664425410/22/201664425410/23/201674425410/24/201684425410/25/201694434910/17/201614434910/17/201614434910/17/201614434910/18/201624434910/18/201624434910/19/201634434910/19/201634434910/19/201634434910/20/201644434910/20/201644434910/20/201654434910/21/201664434910/21/201664434910/21/20166minimum date in range begins count.

 


erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • November 15, 2016

I suggest the following:

Do a DuplicateFilter, based on EmployeeNumber and Working Date.

Use a Counter, where the counter name is a concatenation of EmployeeNumber and Working Date.

That will generate the right sequence.

Then Use the FeatureMerger with the original data (including duplicates) as Requester and the result of the Counter as Supplier (Join on the two first columns) adding the sequence number.

That should get you the required output.

You still need to add the FeatureMerger merging the count attribute to the original data joining on Employee and Work Date. That will re-introduce the duplicates.

 

 


Forum|alt.badge.img
  • Author
  • November 15, 2016
You still need to add the FeatureMerger merging the count attribute to the original data joining on Employee and Work Date. That will re-introduce the duplicates.

 

 

@erik_jan I don't follow you. If everything has a count of (1) coming out of the counter, then I would expect to have a count of (1) for everything after the merge. Am I off base here.

 


erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • November 15, 2016
@erik_jan I don't follow you. If everything has a count of (1) coming out of the counter, then I would expect to have a count of (1) for everything after the merge. Am I off base here.

 

The Counter setting should be on the Employee only. Not (as I said before by mistake) on both attributes.

 

 


Forum|alt.badge.img
  • Author
  • November 15, 2016
@erik_jan that's looking more promising. Thanks. I'll follow up with the merger now and keep you posted.

 


Forum|alt.badge.img
  • Author
  • November 15, 2016
The Counter setting should be on the Employee only. Not (as I said before by mistake) on both attributes.

 

 

@erik_jan that's looking more promising. Thanks. I'll follow up with the merger now and keep you posted.

 


takashi
Celebrity
  • November 15, 2016

Hi @jim, here is another approach, the Enable Adjacent Feature Attributes option and Conditional Value setting in an AttributeCreator (or AttributeManager) might also be helpful.

Conditional Value: