-
Notifications
You must be signed in to change notification settings - Fork 9
Joining tables #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Joining tables #51
Conversation
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 |
gbeeley
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
gbeeley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
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. |
gbeeley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
gbeeley
left a comment
There was a problem hiding this 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.
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.