Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
datanibbler
Esteemed Contributor

Aggregate data of a table that is joined with another?

Hi,

I would like to try out the effect on the size of my current document of an aggregation: The Dashboard I am building is for management - plus one colleague, and only that one colleague needs the item_details.

The hurdle, however, is the fact that another masterdata table is joined via a LEFT JOIN to the masterdata table that I want to aggregate; So the script_tab where this second table connected via LEFT JOIN is loaded is to the right of the one I would have to aggregate - but the GROUP BY clause necessary for any aggregation would necessarily include a field from the second table. I am unsure now as to the sequence in which the operations in the script will be executed: Ideally, of course, the JOIN should be there first so that I can access all the fields I need for the GROUP BY clause.

Can anyone clarify this?

Thanks a lot!

Best regards,

DataNibbler

2 Replies
vikasmahajan
Honored Contributor III

Re: Aggregate data of a table that is joined with another?

SELECT userid,
       awardtypeid
,
       SUM
(awardamount)
FROM   awards a
      
LEFT JOIN userinfo ui
        
ON ui.userid = a.userid
      
LEFT JOIN awardtypes
        
ON awardtypesid = a.awardtypeid
GROUP  BY userid,
          awardtypeid

Thanks

Vikas

datanibbler
Esteemed Contributor

Re: Aggregate data of a table that is joined with another?

Hi,

I didn't know I can use this general SQL-type of SELECT statement in QlikView? Thanks!

However, I don't need the entirety of the table I join via the LEFT JOIN, only a few fields. So I guess I will have to go via a RESIDENT LOAD.

Best regards,

DataNibbler

Community Browser