Skip to main content
Question

Counter Confussion


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.

10 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • 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
david_r wrote:

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
erik_jan wrote:

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+17
  • Contributor
  • November 15, 2016
erik_jan wrote:

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
erik_jan wrote:
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+17
  • Contributor
  • November 15, 2016
jim wrote:
@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
erik_jan wrote:
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
Influencer
  • 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:


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