Add Counting Column
This script will add a new column that will count the number of records based on a field that is selected by the user.
This script will allow you to select a file and a field in which you want to count the items. It will add a row and place the number of that particular entry.
If we use the ACCESS-Database.IMD that is used in the training we can see from the above that for the COUNTRY field we have Albania, Andorra and Angola. We run the script and will get this dialog in which we select the file and the country field.
Once we run the script a new field called COUNT will be added and you will have the following:
So from the above example we see that we have 146 records for Albania, 2 for Andorra and at least 6 for Angola (actually 16). This script will work on character, numeric, date and time fields.
Brian
It is really helpful when I
It is really helpful when I want to create a pivot table showing multiple registers for the same unique key, with this count I can display them as columns, for instance 2 people with same unique ID, I can list 1 register per unique key and list whatever as column.In regard to this, is there any way to create a Pivot Table with anything else beside a numeric as values?
Something like this
http://imgur.com/a/iQRrD
Which version did you write this in?
What version of IDEA was this written in? Will it work in version 10.x? Sorry for asking before trying. I have a script for calculating running balances that gives me errors when I try using it in version 10.x. I have not been able to modify it to work. This is very similar so I can adapt it if it works in 10.
Brian you are the Best!
Thanks a lot Brian.
It would have been better if this could w0rk on numeric fields a well (I believe it only works on Character fields)
Also would be nice if you had a script that would show only the final count. (for eg corresponding to all Albania cells, the number 146 should apply instead of cummulative count). For now im using a work around, summarizing and then joining database. But a scrip would make it easier.
Once again, you are the Best ;)
Thanks for this, this is
Thanks for this, this is exactly what I was looking for, I knew I couldn't be the one wanting to do this so I decided to check this forum, wasn't disappointed :p
Thanks once again!