Skip to content

Conversation

@shiloh-parker
Copy link

I have the tables joined. (152) (Not sure if that is the right spot, maybe tmp_gift_items instead):
left join collection a_pledge p on t.ledger = p.a_ledger_number and t.fund = p.a_fund and t.donor = p.p_donor_partner_id

Here, we can add/use fields using the new data from the pledges table:
a_amount, a_total_amount, a_pledge_date, a_giving_interval, a_gift_count
a_start_date, a_end_date

Then, we can use these values later in the query as a reference to make informed decisions.
I need to figure out how to extinguish ambiguity in one-time, monthly, quarterly, annually, etc.
Possibly add a tag for the gift's "category"?

Rebuild method of analysis or edit the way it is done so far?

(This is the first set of notes. I have some changes dispersed through different files, but I think it would be good to receive comments before submitting potentially incorrect things.

@gbeeley
Copy link
Member

gbeeley commented Jun 28, 2024

I have the tables joined. (152) (Not sure if that is the right spot, maybe tmp_gift_items instead)

Doing a join here could help pull in the data for later analysis, but the pledge table data isn't yet in a collection in the .qy file and so has to be referenced as /apps/kardia/data/Kardia_DB/a_pledge/rows instead of as collection a_pledge, and it'll be more efficient to reference the pledge data after the gift data has been aggregated into possible patterns instead of referencing it here for each gift. The overall approach would be a bit more nuanced, using the pledge data (for example) on giving descriptives that are less certain, like if a descriptive entry just has one gift. But that should be done after at least the first cycle of descriptives have been assembled - and that'll be a lot less data to join than doing joins on the gift data.

Copy link
Member

@gbeeley gbeeley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial round of feedback. :)

collection tmp_gift_items
group by
collection tmp_gift_items t
left join collection a_pledge p on t.ledger = p.a_ledger_number and t.fund = p.a_fund and t.donor = p.p_donor_partner_id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Centrallix doesn't use LEFT JOIN syntax, instead use =* or *= to do an outer join or just plain = to do a normal join.

Also, attribute syntax is :object:attribute instead of object.attribute.

See https://www.centrallix.net/docs/docs.php?t=6.%20SQL%20Language

Copy link
Member

@gbeeley gbeeley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@shiloh-parker
Copy link
Author

I am not sure if I need to add anything else to the Order By section for the insertion into the collection, so that would be great if you could let me know.

Copy link
Member

@gbeeley gbeeley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

Copy link
Member

@gbeeley gbeeley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it's looking better. The next step would be to test the code on the VM. Let me know what you find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants