Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I am trying to get sum of quantity whose value is >2000 and <2000
I want to get sum of last 2 columns. That is total to be displayed at the top of the table . Please help to create expression.
brand |
ID |
QTY |
>2000 |
<2000 |
QTY (>2000) |
QTY (<2000) |
HUMIRA |
G04A-20005289 |
271273 |
1 |
0 |
271273 |
- |
HUMIRA |
G04A-20015888 |
4584 |
1 |
0 |
4584 |
- |
HUMIRA |
G04A-20016957 |
2453 |
1 |
0 |
2453 |
- |
HUMIRA |
G04A-20021980 |
29685 |
1 |
0 |
29685 |
- |
HUMIRA |
G04A-20014985 |
-4 |
0 |
1 |
- |
-4 |
HUMIRA |
G04A-20059013 |
751 |
0 |
1 |
- |
751 |
HUMIRA |
G04A-20059014 |
34 |
0 |
1 |
- |
34 |
Hi,
After your condition, close your expression so that it can give you the sum of the results, perhaps this:
Sum(aggr(Conditional Expression, ID, brand))
- Regards, Matheus
But conditional expression is like this
sum(aggr(fabs(num($(vActuals_YearToDate),'###0'))>'2000',dfu))*-1
which gives value 1 for each row.
But I want to calculate sum of qty
This could not be done in the following way using if() or pick(), of course I am assuming the scenario to which I send an example.
sum(aggr(if( Sum(QTY)<2000,Sum(QTY),0),ID,brand))
or
sum(aggr(if( Sum(QTY)<2000,Sum(QTY),0),ID))