Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with linear table

Hi guys,

I have some problem with a linear table.

I would like to post a qvw file but unfortunately I can't so I try to explain my problem and I post an xls file to be as clear as I can.

I'm playing with sap data.

My goal is to find an expression to calculate TOTAL COST PER TRAVEL.

So, up to now, I have this expressions that sound ok:

- total Cost per CDC (CDC = Cost Center)   

- total Km per CDC   

- unit cost per KM    

- CDC cost per travel

 

What I'm looking for is to calculate total cost per travel.

In my last expression I have "CDC cost per travel". Now I want to sum those costs per single travel.

I tried with:

=aggr( sum(Column(4)), VBELN )

but it doesn't work.

I attached an xls file to better undrstand my problem.

I exported my linear table on it.

I'll appreciate any suggestion.

Best regards

Giampiero

1 Solution

Accepted Solutions
Not applicable
Author

Probably my last try:

sum(TOTAL <VBELN> aggr(sum(TOTAL <Doc_CO.CDC> VG_CO.WKGBTR)*ZZ_KM_ESTT/sum(TOTAL <Doc_CO.CDC>ZZ_KM_ESTT),Doc_CO.CDC,VBELN))

Kiran.

View solution in original post

12 Replies
Not applicable
Author

I am not sure but did you try: sum(total <VBELN> Column(4))?

Kiran.

Not applicable
Author

Hi Kiran,

Yes, I did.

Unfortunately it doesn't work.

Thank you very much.

Giampiero

Not applicable
Author

=sum(aggr(sum(distinct {<VBELN=>} VG_CO.WKGBTR)/sum(distinct {<VBELN=>} ZZ_KM_ESTT),Doc_CO.CDC)*ZZ_KM_ESTT)

May be.

Kiran.

Not applicable
Author

Unfortunately it doesn't work.

I'm really appreciating your help Kiran.

Giampiero

Not applicable
Author

Probably my last try:

sum(TOTAL <VBELN> aggr(sum(TOTAL <Doc_CO.CDC> VG_CO.WKGBTR)*ZZ_KM_ESTT/sum(TOTAL <Doc_CO.CDC>ZZ_KM_ESTT),Doc_CO.CDC,VBELN))

Kiran.

Not applicable
Author

Kiran,

it still doesn't work but it seems to be a good way.

Thanks

Giampiero

Not applicable
Author

For the results in excel shared can you share core values?

Basicaly what needs to be done is to try and seperate the table in qv datamodel to aviod the total function.

Regards,

Kiran Rokkam.

Not applicable
Author

you can't cheat dimension on table (aggr, set analysis.....)

can't you use pivot table and total ?

Not applicable
Author

Kiran,

I think that your idea to work on the data model is a chance.

I thought to separate the tables, and now I think to try it.

Regards

Giampiero