Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I need to calculate the running total in script level, combination of Plant code and Item code, Please suggest to me ASAP, We have script like this,
Data:
LOAD
PLANT_CODE,
ITEM_CODE,
Key1,
DUE_DATE,
ITEM_DESCRIPTION,
ITEM_TYPE,
"Item Code Description",
"VENDOR_NUM" ,
"VENDOR_NAME",
"PO_NUMBER",
UOM,
COST,
day_key,
sum(ON_QTY) as ON_QTY,
DIM_TIME.REAL_DATE,
sum(EPO_QTY) as EPO_QTY,
sum(USAGE_QTY) as USAGE_QTY,
sum(Demand_QTY) as Demand_QTY
FROM [lib://DM_IPD_QVDs/Fact/Resin_Final_Master_Table.qvd]
(qvd)
group By
PLANT_CODE,
ITEM_CODE,
Key1,
DUE_DATE,
ITEM_DESCRIPTION,
ITEM_TYPE,
"Item Code Descriptio",
UOM,
COST,
day_key,
DIM_TIME.REAL_DATE,"VENDOR_NUM" ,
"VENDOR_NAME",
"PO_NUMBER";
Data:
LOAD
PLANT_CODE,
ITEM_CODE,
Key1,
DUE_DATE,
ITEM_DESCRIPTION,
ITEM_TYPE,
"Item Code Description",
"VENDOR_NUM" ,
"VENDOR_NAME",
"PO_NUMBER",
UOM,
COST,
day_key,
sum(ON_QTY) as ON_QTY,
DIM_TIME.REAL_DATE,
sum(EPO_QTY) as EPO_QTY,
sum(USAGE_QTY) as USAGE_QTY,
sum(Demand_QTY) as Demand_QTY
FROM [lib://DM_IPD_QVDs/Fact/Resin_Final_Master_Table.qvd]
(qvd)
group By
PLANT_CODE,
ITEM_CODE;
Take Straight table & display fields dim : Plant_Code & Iteam Code
in expression sum(EPO_QTY) etc...
Hope this helps
Vikas
Hi Vikas,
i need to achieve the running total in script level based on plant Code and Item Code
Then join with this code
Right Join(Data)
LOAD
PLANT_CODE,
ITEM_CODE,
sum(EPO_QTY) as EPO_QTY,
sum(USAGE_QTY) as USAGE_QTY,
sum(Demand_QTY) as Demand_QTY
Resident Data Group By PLANT_CODE,ITEM_CODE Order By PLANT_CODE,ITEM_CODE ;
but i need to calculate the running sum value in script level, you have, can we connect some time
Please anyone suggest still this issue is not completed, i need to calculate the running total in script level based on Plant and Item code
Sorry for late reply
Data:
LOAD * Inline [
Date,Plant, Item, Factor, Value
March,P1, NAM, 1, 50
March,P1, NAM, 3, 25
March,P1, NAM, 12, 10
March,P2, AFI, 5, 200
March,P2, AFI, 9, 100
March,P2, AFI, 1, 75
April,P3, NAM, 10, 500
April,P3, NAM, 11, 250
April,P3, NAM, 3, 150
April,P4, AFI, 8, 90
April,P4, AFI, 3, 30
April,P4, AFI, 1, 10
];
**bleep**:
NoConcatenate
LOAD Date,Plant,Item,Value,
if(Previous(Date)=Date and Previous(Item)=Item and Previous(Plant)=Plant , RangeSum(Value,Peek('Cummulative Sales')),Value) as [Cummulative Sales]
Resident Data
Order by Date,Plant,Item;
drop Table Data;
you can create script like this.
Vikas
I have tried above script but still cumulative values are not coming, see below screenshot