Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a qvd with following fields
YearMonth,
Calendar_Year,
Plant,
BUEqui,
Strategic_Flag,
Country,
Contract_Type,
Part_Type,
Fiscal_Month,
ITM_IB,
ITM_Consumption
and to get YTD logic i have given the below condition:
FinalTable:
LOAD*,
If(BUEqui = Previous(BUEqui) and Plant = Previous(Plant) and Calendar_Year = Previous(Calendar_Year) , RangeSum(ITM_Consumption, Peek('YTD_Consumption')), ITM_Consumption) as YTD_Consumption
Resident QV_intermediate_temp5
order by BUEqui,Plant,YearMonth ;
DROP Table QV_intermediate_temp5;
Below image for reference:
If you see my YTD_cons for Jan is fine but for feb instead of 1934+6913 =8847 i am getting 176974.
Can you please help where i am doing wrong.
Attached app for reference.
Thanks,
Bharat
Check now
Sunny Bhai.. Thank you so much. Thanks a lot..
One last question can you please tell me why you have given these two steps:
AutoNumber(Plant&BUEqui&Strategic_Flag&Country&Contract_Type&Part_Type&ITM_IB&Calendar_Year) as Key,
Sum(ITM_Consumption) as ITM_Consumption
why we did sum(ITM_Consumption)..
Please..Kindly wanted to know.
1) Created Key as it helped make the if condition and Order by easier... you don't have to create the Key... but then you will have to add all the fields from the Key into your if condition and Order By
2) Sum because like I mentioned before... you have multiple rows for each combination of Key making Previous function not work the way you would expect it to work
Thanks a lot Sunny Bhai. Thank you so much. I know you don't like to say these many times.. But thank you so much..