Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
darrellbutler
Creator
Creator

Aggr Function?

Hi, I have a fact table containing invoices. Each invoice has an invoice ID, which is then linked to a dimension table on Invoice ID. My dimension table includes site (an invoice can be split across many sites) .

When I design a straight table with site as the dimension and the sum of invoices I get the grand total against each site, when in fact I need the sites total the sum of which should equal the grand total.

Any advice greatly appreciated.

rgds

3 Replies
derekjones
Creator III
Creator III

Hi FirstMilk

Bit confused, if your 'site' is in the dimension table, and there are multiple sites to an invoice, if the invoice table contains the invoice value but no recogonition of what site that particular invoice value is related to, it will be impossible to sum invoice value on site.

If you can provide a simple example of you data structure, I may understand better what you are trying to achieve.

Thanks

Derek

darrellbutler
Creator
Creator
Author

Derek your analysis is spot on, I thought by linking on invoice_id it would understand the relationship between amount and site.

Perhaps I should bring site into the fact table ?

derekjones
Creator III
Creator III

Yes, I'm afraid so, there's no way to split up invoice values by site if you cannot identify the site of an invoice in the fact table.

Good luck.

Derek