Notices


Reply
 
LinkBack Thread Tools Display Modes

Old 06-08-2007, 11:37 AM   #1 (permalink)
Senior Member

Join Date: Sep 2006
Posts: 257
Rep Power: 3 jas. is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)

consecutive years at current level?

I'm not sure if this should be in here, or where... maybe we need a 'how do i do this report?' forum.

Do any of you have any ideas on how to report on a member's consecutive years in his current category? I know how to pull consecutive years as a member, and how to export a membership history; I'm just kind of stumped on how to report on someone's years at a certain level...

I exported, say, 15 years of membership history to Access, and started to query on it, with things like this:

history-cat1 = category AND type <> dropped
AND history-cat2 = category AND type <> dropped
AND history-cat3=category AND type <> dropped
AND history-cat4 <> category

and so on. barring a lot of midcycle upgrading and downgrading, that should give a reasonable number, right? I guess I could do something similar, but make the type for each 'renewal'?

Basically they want to see of the people in this category, how many have been there for 1-5 years, how many 5-7, etc.

anyone have any thoughts?
__________________
james andrews
manager of development services
philadelphia museum of art
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 06-08-2007, 01:34 PM   #2 (permalink)
Crystal Reports Guru

DrewAllen's Avatar

Join Date: May 2006
Location: Philadelphia, PA
Posts: 1,160
Rep Power: 4 DrewAllen is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)
- Information Edge (TIE)
- API/VBA

It can be done, but it gets complicated. I know this can be done in SQL. I'm guessing that it could also be done in MS Access.

You need to start with a table that contains the constituent ID, the (fiscal) year, and the membership level for that year. If you have multiple membership categories, you would also need to include the membership category. Then you need to join this table to itself to find the beginnings of runs.
Code:
SELECT a.ConsID, a.Level, a.[Year]
FROM Members AS a
LEFT OUTER JOIN Members AS b
ON a.ConsID = b.ConsID
AND a.Level = b.Level
AND a.[Year] = b.[Year] + 1
WHERE b.[Year] Is Null
 
You'll also need a similar code for the ends of runs. You'll probably want to save the results of both of these queries to temporary tables, because that makes it easier to work with the results. Once you have these tables, then you can either do a sub-query or a join to get the final results. I'll show you the join, because that's slight easier to understand.

Code:
SELECT e.ConsID, Minimum(e.[Year] - b.[Year]), e.Level
FROM RunBegin AS b
INNER JOIN RunEnd AS e
ON b.ConsID = e.ConsID
AND b.Level = e.Level
AND b.[Year] <= e.[Year]
WHERE e.[Year] = 2007
GROUP BY e.ConsID
 
This algorithm basically requires two unusual join conditions. The first is used in finding the beginnings/ends of runs. Instead of joining one field to another, you are joining a field to an expression "a.[Year] = b.[Year] + 1". In the other case, you are not using an equal operator, but a less than or equal operator to join the two tables.

Drew
__________________
J. Drew Allen
Children's Hospital of Philadelphia

Crystal Reports and SQL Server Consultant

It is better to live your destiny imperfectly than to live an imitation of somebody else's life with perfection.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 06-08-2007, 03:06 PM   #3 (permalink)
Senior Member

Join Date: Sep 2006
Posts: 257
Rep Power: 3 jas. is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)

wow. I have to admit that's even more complicated than I thought it would be. I'll have to look into it further next week. Thanks!
__________________
james andrews
manager of development services
philadelphia museum of art
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 06-08-2007, 03:12 PM   #4 (permalink)
Crystal Reports Guru

DrewAllen's Avatar

Join Date: May 2006
Location: Philadelphia, PA
Posts: 1,160
Rep Power: 4 DrewAllen is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)
- Information Edge (TIE)
- API/VBA

Quote:
Originally Posted by jas. View Post
wow. I have to admit that's even more complicated than I thought it would be. I'll have to look into it further next week. Thanks!
Well, in SQL you could also use CURSORS which are less complicated, but far less efficient.

Drew
__________________
J. Drew Allen
Children's Hospital of Philadelphia

Crystal Reports and SQL Server Consultant

It is better to live your destiny imperfectly than to live an imitation of somebody else's life with perfection.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
consecutive years, membership


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Loans - Loans - Credit Counseling - Mortgage
All times are GMT -6. The time now is 07:59 AM.

Miscellaneous


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by BBpixel Team 2008 :: jvbPlugin R1012.364.1

SEO by vBSEO 3.2.0 Copyright 2008 Blackbaud User SocietyAd Management by RedTyger
Inactive Reminders By Icora Web Design

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64