Question

Counter Confussion

  • 15 November 2016
  • 10 replies
  • 10 views

Badge

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

Userlevel 2
Badge +16

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.

Userlevel 4

Try the Aggregator:

 

Badge

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.
Badge

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.

 

Userlevel 2
Badge +16

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.

 

 

Badge
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.

 

Userlevel 2
Badge +16
@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.

 

 

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

 

Badge
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.

 

Userlevel 2
Badge +17

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:

Reply