Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Product n° | Salesman name | Qty | Qty recalculated | Total quantity by product |
1 | PT | 5 | 5 | 15 |
1 | PL | 5 | 5 | 15 |
1 | PM | 2 | 2 | 15 |
1 | PO | 0 | 3 | 15 |
2 | PT | 9 | 9 | 74 |
2 | PL | 15 | 15 | 74 |
2 | PM | 36 | 36 | 74 |
2 | PO | 14 | 14 | 74 |
I have this expression for the column Quantity recalculated and it works:
if($(v_Qty_LY)=0,($(v_Qty_Total_LY)/$(v_Nb_Salesman)),$(v_Qty_LY)) |
I tried to create an expression to calculate the total quantity by product but it doesn't count the value that replaced the 0.
For example, I don't find 15 but 12. Here is the expression that I created :
Sum(Aggr(NODISTINCT($(v_Qty_recalculated_LY)),Material_Code)) |
Thanks in advance for your help
Regards
Loreen
May be try this
Sum(TOTAL <[Product n°]> Aggr(
If($(v_Qty_LY) = 0, ($(v_Qty_Total_LY)/$(v_Nb_Salesman)),$(v_Qty_LY))
, [Product n°], [Salesman name]))
This solution worked. But now, I'd like to keep the quantity total by product, even when I filter the salesman.
For example, when I filter the Salesman PT, I have
Product n° | Salesman name | Qty | Qty recalculated | Total quantity by product |
1 | PT | 5 | 5 | 5 |
2 | PT | 9 | 9 | 9 |
And I'd like to have
Product n° | Salesman name | Qty | Qty recalculated | Total quantity by product |
1 | PT | 5 | 5 | 15 |
2 | PT | 9 | 9 | 74 |
I'd like to have the same result as with this expression
Sum(Aggr(NODISTINCT($(v_Qty_recalculated_LY)),Material_Code)) |
except that this expression does not take into account when the qty is recalculated, like I said in my previous post.
I tried by adding {<Salesman_name=,Salesname_Code=>} in my expression but it does not work.
Do you have any solution ?
Thanks in advance
Loreen
Where exactly did you use this in your expression?
{<Salesman_name=,Salesname_Code=>}
You have shared expressions with variables, can you share the expressions behind those variables?