Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
sum(aggr(NODISTINCT sum({1<TransType = {2} >} QTY),TransRefId))
Working fine while only 1 line in range with the same TRANSTYPE + TransRefId, but if we have more than 1 line - something wrong.
In ex. is 3 lines with the same TransType and TransRefId and result of sum is 9??? must be 3
ItemId | DatePhysical | Qty | TransType | TransRefId |
JE-9011800 | 2018.07.03 | 3 | 2 | gu074031 |
JE-9011800 | 2018.07.03 | -3 | 2 | gu074031 |
JE-9011800 | 2018.07.03 | 3 | 2 | gu074031 |
PA-GR-KV-PASA-00-02 | 2018.07.03 | -1,172 | 1 | gu074031 |
PA-GR-KT-KUKU-00-03 | 2018.07.03 | -0,752 | 1 | gu074031 |
PA-GR-KT-KUKU-00-03 | 2018.07.03 | -0,003 | 1 | gu074031 |
PA-04-SAR-00-0-00-01 | 2018.07.03 | -0,006 | 1 | gu074031 |
PA-04-SAR-00-0-00-01 | 2018.07.03 | -0,364 | 1 | gu074031 |
PA-04-SAR-00-0-00-01 | 2018.07.03 | -0,001 | 1 | gu074031 |
PA-03-SAU-00-0-99-02 | 2018.07.03 | -23,9 | 1 | gu074031 |
PA-03-SAU-00-0-99-02 | 2018.07.03 | -156,1 | 1 | gu074031 |
PA-06-RUG-00-0-00-01 | 2018.07.03 | -0,149 | 1 | gu074031 |
PA-14-MIE-00-0-09-07 | 2018.07.03 | -0,09 | 1 | gu074031 |
PA-14-MIE-00-0-09-07 | 2018.07.03 | -0,003 | 1 | gu074031 |
PA-04-KOK-00-0-99-01 | 2018.07.03 | -0,025 | 1 | gu074031 |
PA-04-RIE-00-50-01 | 2018.07.03 | -45 | 1 | gu074031 |
PA-04-KAN-00-0-99-02 | 2018.07.03 | -0,054 | 1 | gu074031 |
PA-04-KAN-00-0-99-02 | 2018.07.03 | -0,003 | 1 | gu074031 |
PA-08-CIB-00-0-99-01 | 2018.07.03 | -6 | 1 | gu074031 |
PA-08-CIB-00-0-99-01 | 2018.07.03 | 6 | 1 | gu074031 |
PA-12-NAC-00-0-50-01 | 2018.07.03 | -0,015 | 1 | gu074031 |
PA-GR-KT-ZIRN-00-03 | 2018.07.03 | -0,15 | 1 | gu074031 |
Z-GPS-PRIEM | 2018.07.03 | -3 | 1 | gu074031 |
Z-GPS-SMULK | 2018.07.03 | -3 | 1 | gu074031 |
Z-GPS-ATKRO | 2018.07.03 | -3 | 1 | gu074031 |
Z-GPS-GRANU | 2018.07.03 | -3 | 1 | gu074031 |
Maybe I must write all needs:
I have Invettrans table, were are all items transactions as you can see in my first post.
I need by selecting ItemId (TransType - "1") to find SUM of Item QTY, and in other field - SUM of all trans with TransType is "2" and TransRefId is the same as range by selected ItemId
Finally, Thank you Stefan - working:)