I have 2 datasets that I need to populate one table. Dataset 1 contains values that Dataset 2 may not contain. Dataset 2 contains multiple values that I need to get the Sum of. Dataset 2 will always have a matching value (Division_Code) that is contained in Dataset 1.
I need the full list of data from DataSet1, even if no data exists in Dataset2.
Dataset 1 fields: Division_Code, Long_Name
Dataset 2 fields: Division_Code, TotalBillable, Date
i.e. Dataset 1:
Division_Code | Long_Name |
---|---|
01 | Health |
02 | Safety |
03 | Finance |
04 | Tax |
i.e. Dataset 2:
Division_Code | TotalBillable | Date |
---|---|---|
01 | $200 | 06/01/2022 |
01 | $100 | 06/08/2022 |
01 | $200 | 06/12/2022 |
02 | $800 | 06/01/2022 |
04 | $100 | 06/05/2022 |
I need results like this:
Division_Code | Long_Name | Sum(TotalBillable) |
---|---|---|
01 | Health | $500 |
02 | Safety | $800 |
03 | Finance | 0 |
04 | Tax | $100 |
I have tried a variety of Lookups and SumLookup expressions and all result in errors. Can anyone offer guidance on how to write an expression that would accomplish what I need? Thanks in advance.