I have a table with all the invoice lines. One invoice can spread on multiple lines (for example 2 products, 1 discount, 1 delivery fees, so a total of 4 lines here)
Facts table :
- OrderNumber
- Line type
- Amount
Now I need some basic information like
- number of orders
- average basket
My question is : Is it easier to work directly on this table only (for example with a count(distinct()), or is it better to create a table that will aggregate the data? For example :