Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
geam1988
Creator
Creator

Cost analysis as per position

I am trying to do cost analysis as per position.   cost as per sales order is working properly but when i want to see the cost as per position. it shows the same value for every position.

Wish to see the result like this ,

SUM(COSS.WTG007     )   for  500016393 - 010400

SUM(COSP.WTG007   )   for   500016393 - 010300

Sum(KONV.KWERT)       for     500016393 - 010500

As per positon getting result like this,  Wrong

  

As per Sales order,

Do not hesitate co contact me if you have any question. 

5 Replies
YoussefBelloum
Champion
Champion

Hi,

would you be able to share your source table structure and the script you're using ?

geam1988
Creator
Creator
Author

// Auftragsstammdaten

AUFK:
LOAD AUFK.MANDT,
AUFK.AUFNR,  
AUFK.OBJNR,
AUFK.KDAUF
AUFK.KDAUF as VBAK.VBELN,        
AUFK.UPDATE_CONTROL

FROM
[..\..\PROD\20_QVD_ROH\SAP\AUFK.QVD]
(
qvd);



Left join (AUFK)
Load Distinct
VBAK.VBELN
Resident VBAK;


// CO-Objekt: Summen Kosten - interne Buchungen


COSS:

LOAD *,
COSS.WTG001 + COSS.WTG002 + COSS.WTG003 + COSS.WTG004COSS.WTG005 + COSS.WTG006 + COSS.WTG007 + COSS.WTG008 + COSS.WTG009 + COSS.WTG010 + COSS.WTG011 + COSS.WTG012 + COSS.WTG013 + COSS.WTG014 + COSS.WTG015 + COSS.WTG016 as TOTAL.COSS
;



LOAD COSS.MANDT,
COSS.LEDNR,
COSS.OBJNR as AUFK.OBJNR,
COSS.GJAHR,
COSS.WRTTP,
COSS.VERSN,
COSS.KSTAR,
COSS.HRKFT,
COSS.VRGNG,
COSS.PAROB,
COSS.USPOB,
COSS.BEKNZ,
COSS.TWAER,
COSS.PERBL,
COSS.MEINH,

COSS.WTG001,
COSS.WTG002,
COSS.WTG003,
COSS.WTG004,
COSS.WTG005,
COSS.WTG006,
COSS.WTG007,
COSS.WTG008,
COSS.WTG009,
COSS.WTG010,
COSS.WTG011,
COSS.WTG012,
COSS.WTG013,
COSS.WTG014,
COSS.WTG015,
COSS.WTG016,

COSS.BUDGET_PD
FROM
[..\..\PROD\20_QVD_ROH\SAP\COSS.QVD]
(
qvd)

where COSS.VRGNG = 'KOAO' OR COSS.VRGNG = 'KZPI' OR COSS.VRGNG = 'RKL'
;

Left join (COSS)
Load Distinct
AUFK.OBJNR
Resident AUFK;


/*
Left join (COSS)
Load Distinct
KEPH.MEK
Resident AUFK;
*/


// CO-Objekt: Summen Kosten - externe Buchungen


COSP:

LOAD *,

COSP.WTG001 + COSP.WTG002 + COSP.WTG003 + COSP.WTG004 + COSP.WTG005 + COSP.WTG006 + COSP.WTG007 + COSP.WTG008 + COSP.WTG009 + COSP.WTG010 + COSP.WTG011 + COSP.WTG012 + COSP.WTG013 + COSP.WTG014 + COSP.WTG015 + COSP.WTG016 as TOTAL.COSP;



LOAD COSP.MANDT,
COSP.LEDNR,
COSP.OBJNR as AUFK.OBJNR,
COSP.GJAHR,
COSP.WRTTP,
COSP.VERSN,
COSP.KSTAR,
COSP.HRKFT,
COSP.VRGNG,
COSP.VBUND,
COSP.PARGB,
COSP.BEKNZ,
COSP.TWAER,
COSP.PERBL,
COSP.MEINH,

COSP.WTG001,
COSP.WTG002,
COSP.WTG003,
COSP.WTG004,
COSP.WTG005,
COSP.WTG006,
COSP.WTG007,
COSP.WTG008,
COSP.WTG009,
COSP.WTG010,
COSP.WTG011,
COSP.WTG012,
COSP.WTG013,
COSP.WTG014,
COSP.WTG015,
COSP.WTG016,
COSP.BUDGET_PD

FROM
[..\..\PROD\20_QVD_ROH\SAP\COSP.QVD]
(
qvd)
where COSP.VRGNG =  'COIN'
;


Left join (COSP)
Load Distinct
AUFK.OBJNR
Resident AUFK;


Are you looking for this ?

YoussefBelloum
Champion
Champion

it may help yes...

what are the dimensions/expressions used on the table where the result is wrong

and what are those used on the table (Sales order) where the result is good ?

geam1988
Creator
Creator
Author

result is wrong

Dimensions

VBAP.VBELN

VBAP.POSNR

Expressions

SUM(COSS.WTG007)  

SUM(COSP.WTG007 ) 

Sum(KONV.KWERT)    

result is good

Dimensions

VBAP.VBELN

Expressions

SUM(COSS.WTG007)  

SUM(COSP.WTG007 ) 

Sum(KONV.KWERT)   

i want to show the result as per position .

geam1988
Creator
Creator
Author

FYI..

for the position 10300 and 10400 i do not have internal price

for position 10500 i have internal price and it show the value as per position. getting the value from KONV table.