Sum select multiple column in related child by specific row

Hello guys,

I need a help in my expression.

How do i achieve my goal in 1 expression only.

I have an related child with a column named [Jo#] , [Good] , [Reworks] , [Spoilage] , [MR Spoilage]

and I create 4 virtual column in my parent then i enter this expression

for Virtual Column 1

SUM(
SELECT(
Offset Process Slip Sheet[Good],
([Jo#] = [_THISROW].[Jo#])))

for Virtual Column 2

SUM(
SELECT(
Offset Process Slip Sheet[Reworks],
([Jo#] = [_THISROW].[Jo#])))

for Virtual Column 3

SUM(
SELECT(
Offset Process Slip Sheet[Spoilage],
([Jo#] = [_THISROW].[Jo#])))

for Virtual Column 4

SUM(
SELECT(
Offset Process Slip Sheet[MR Spoilage],
([Jo#] = [_THISROW].[Jo#])))


I put this to get the sum value of each column by specific [Jo#]

Instead of doing 4 Virtual Column then add the 4 virtual column to get the total.

How do I sum the 4 column in 1 expression only?

I try the 

SUM(
SELECT(
Offset Process Slip Sheet[Good],
AND(
Offset Process Slip Sheet[Reworks],
AND(
Offset Process Slip Sheet[Spoilage],
AND(
Offset Process Slip Sheet[MR Spoilage],
([Jo#] = [_THISROW].[Jo#])
)
)
)
)
)

and

SUM(
SELECT(
Offset Process Slip Sheet[Good],
AND(
Offset Process Slip Sheet[Reworks],
AND(
Offset Process Slip Sheet[Spoilage],
AND(
Offset Process Slip Sheet[MR Spoilage],
([Jo#] = [_THISROW].[Jo#])
)
)
)
)
)

 

Thank you in advance!

 

Solved Solved
0 17 499
1 ACCEPTED SOLUTION

Okay, thank you for the details.

Technically, you can simply add those expressions in one VC something like 

SUM(
SELECT(
Offset Process Slip Sheet[Good],
([Jo#] = [_THISROW].[Jo#])))

+

SUM(
SELECT(
Offset Process Slip Sheet[Reworks],
([Jo#] = [_THISROW].[Jo#])))

+

SUM(
SELECT(
Offset Process Slip Sheet[Spoilage],
([Jo#] = [_THISROW].[Jo#])))

+

SUM(
SELECT(
Offset Process Slip Sheet[MR Spoilage],
([Jo#] = [_THISROW].[Jo#])))

 

But using 4 SELECT() expressions in a VC can be very much sync expensive. 

So as an alternative, please try the following

Please create a VC called say [Total_Quantities] in your child table with an expression something like 

[Good] + [Reworks] + [Spoilage]+[MR Spoilage]

Then in the parent table, the expression can be something like

SELECT( [Related Offset Process Slip Sheets][Total_Quantities], [Jo#]=[_THISROW].[Jo#])

 

 

View solution in original post

17 REPLIES 17
Top Labels in this Space