GDF_kuma
GDF_kuma

Reputation: 95

Phonograph query: how to join 2 datasets and get distinct

My question concerns Slate + Phonograph end point. Solution can be expressed using ontology and objects creation but my business domain doesn't have permission to use them so I prefer to discuss about Slate + Phonograph.

My questions are at the end, first let me explain the context simplified like this:

  1. I sync to foundry the database of a "tickets and actions management system" and I get 2 datasets:
    • one for TICKETS primary key = ticket_number
    • the other for TICKET'S ACTIONS primary key = action_number, secondary key = ticket_number
  2. In a Slate application, user can observe charts and higlights about TICKETS and ACTIONS filtered on creteria relative to TICKETS' properties and ACTIONS' properties. For instance let's says displaying count of opened Actions allocated to an urgent Ticket opened last year.

To achive that I have 2 solutions:

  1. perform 2 successive phonograph queries:
    • 1st. query on TICKETS filtered on "Urgent Ticket opened last year" => return TICKET NUMBERS
    • 2nd query on ACTIONS filter on TICKET NUMBERS of the previous query
    • (or in the reverse order: 1st ACTION, 2nd TICKET).
  2. work with only 1 dataset which is already the "join" of TICKETS and ACTIONS.

My concerns and questions are:

Best regards.

Upvotes: 0

Views: 188

Answers (0)

Related Questions