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