Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am facing some issue while calculating cumulative sum in Qliksense Table.
Following is the expression :
Sum(Aggr(RangeSum(Above(If(Column(5)='No'
,0,If(OrderDate=Date(BillDate,'DD-MM-YYYY'),Sum(OrderQty)-Sum(BilledQty),Sum(OrderQty))),0, RowNo())),DepotCode,MaterialNo,OrderDate,Key))
where Column(5) is the inscope column
Expected Cumulative Remaining Qty |
0 |
0 |
3 |
8 |
Please give your valuable feedback and Thanks in Advance.
Regards,
Yash P.
The issue got solved.
Used Sorting in AGGR.
(Aggr(RangeSum(Above( Sum(RemainingQty), 0, RowNo(TOTAL))),(DepotCode,TEXT,ASCENDING),(MaterialNo,TEXT,ASCENDING),(OrderDate,Numeric,ASCENDING),(Key,Text,ASCENDING)))
Thanks For Your Support.
You can add column reference within the Aggr() function... you need to replace Column(5) with the actual expression behind that column.
We Tried that too but it gives the same output.
Following the expression :
Sum(Aggr(RangeSum(Above(If(if((((Norm)/Right(MaterialNo,6))*1000) >0 and Num(Sum(OrderQty),'#,##0.00') <(0.33 * (((Norm)/Right(MaterialNo,6))*1000) ),'Yes','No')='No',0,If(OrderDate=Date(BillDate,'DD-MM-YYYY'),Sum(OrderQty)-Sum(BilledQty),Sum(OrderQty))), 0, RowNo())),DepotCode,MaterialNo,OrderDate,Key))
//If Inscope value is 'No' then remaining qty will be zero and if orderdate and billing date is not same then remaining qty will be same as order qty.
What is Key here? may be you need to sort Key
DepotCode, MaterialNo, OrderDate, (Key, (NUMERIC))
Key is the composite of Material and Invoice no used to join Order table and billed table from where Billed Qty is coming.
Cumulative Sum need to be aggregated when DepotCode , Materialno and Orderdate are same.
You might have already tried this, but is this not working?
RangeSum(Above(
If(Column(5) = 'No', 0,
If(OrderDate = BillDate,
Sum(OrderQty) - Sum(BilledQty),
Sum(OrderQty)
)
)
, 0, RowNo()))
No, It is not working, below is the screenshot.
Would you be able to share a sample to check this out?
PFA sample app.
What selections do I make to see the above scenarios?