SUM(SELECT()) Returning "0"

Good day Everyone, 

I am having an issue and id like to know what i am doing wrong here : 

I want to get the sum from a table into another table based on 2 conditions , so i have used the following expression but when i test it , it returns 0: 


SUM(
SELECT(
INVOICES[WEIGHT],
AND(
([TRUCK REF] = [_THISROW].[TRUCK REF]),
([BUILD UP STATUS] = "LOOSE")
)
)
)

Table to get the sum from is INVOICES 

column to be summed : WEIGHT
Truck Ref can be assigned to more than 1 shipment , can be a loose shipment or a solid released shipment 

so i have specified to sum the weight only for the LOOSE Shipments, ignoring the SOLID ones.

What is wrong with my expression and why the returned value is 0 ? 

 

Thanks in advance

 

Solved Solved
0 2 122
1 ACCEPTED SOLUTION

To see what is happening, debug your expression from simple to complex.

  1.  INVOICE[WEIGHT] - a List of weight?
  2. SELECT(INVOICE[WEIGHT], [TRUCK REF] = [_THISROW].[TRUCK REF]
  3. and so on...

View solution in original post

2 REPLIES 2

To see what is happening, debug your expression from simple to complex.

  1.  INVOICE[WEIGHT] - a List of weight?
  2. SELECT(INVOICE[WEIGHT], [TRUCK REF] = [_THISROW].[TRUCK REF]
  3. and so on...

thanks @TeeSee1 i broke it down andd figured it out

Top Labels in this Space