SUM Expression: How to SUM from two tables?

Hello!

I would like to know if I can SUM up these two as one.
(SELECT(PARTICIPATION[Dosage],[Student ID]=[_THISROW].[Student ID]))
(SELECT(REFERRAL[Dosage],[Student ID]=[_THISROW].[Student ID]))

Please advise. Thank you.

Solved Solved
0 8 793
1 ACCEPTED SOLUTION

You should be able to read it directly from related child virtual lists likeโ€ฆ
SELECT([RelatedParticiptions][Dosage],TRUE)+SELECT([RelatedReferrals][Dosage],TRUE)

View solution in original post

8 REPLIES 8

@Kevin_Chan

(SELECT(PARTICIPATION[Dosage],[Student ID]=[_THISROW].[Student ID])) + (SELECT(REFERRAL[Dosage],[Student ID]=[_THISROW].[Student ID]))

WOW! I have been trying with the AND () and I couldnโ€™t make it work but you added a โ€œ+โ€ and it works. Thank you.

Youโ€™re welcome @Kevin_Chan

Btwโ€ฆ do you have relationships between these tables?

@Aleksi Based on this, it looks like these two tables have relationships. Correct me if Iโ€™m wrong.

You should be able to read it directly from related child virtual lists likeโ€ฆ
SELECT([RelatedParticiptions][Dosage],TRUE)+SELECT([RelatedReferrals][Dosage],TRUE)

@Aleksi, I tried your expression and yes it works. Thank you.

With that syntax you donโ€™t need to read two tables totally. You only need to read the virtual related records list.

Top Labels in this Space