3 Replies Latest reply: Dec 19, 2013 6:05 AM by Daniel Oberbillig

# Profit and loss statement: value and percentage

How would you do this with QV?

If I try to do it with a straight table, the first problem I'm faced with is that expressions (net sales value, cost of matereial,...) appear in the columns instead of the rows. How can I transpose it?

Second is that I don't know how to show values and percentages in 2 columns at a time. I can group the expressions in pairs (values with percentages) and cycle between them but I want to see both at a time.

Thanks for helping.

• ###### Re: Profit and loss statement: value and percentage

depends on the structure of your input data.

it could look like this (see .qvw file attached)

Regards

Daniel

• ###### Re: Profit and loss statement: value and percentage

The structure of my database is something like one record for each sales line with these fields:

CUSTOMER

COUNTRY

PRODUCT

...

SALES VALUE

COST OF MATERIAL

OPERATING EXPENSES

And I want to have the P&L as shown above. Besides there will be list boxes with customers, countries, products, etc. so I can filter the scope of the P&L.

Actually, I imagine this like a table with no dimensions and only expresions, some of them showing sum(field x) and others sum(field x)/sum(sales field). Problem is: How to show the expressions in pairs within 2 columns?

Thanks to all.

• ###### Re: Re: Profit and loss statement: value and percentage

Please find attached another example based on your data structure. Sorry, my script is definately not very nice...but maybe it gives you an idea of how it works

• ###### Re: Profit and loss statement: value and percentage

Hi Carlos,

Regarding transposing columns, go to properties>presentation> check the box 'horizontal'.

Concerning the proportions you'd like to show, here are a couple options:

1) Properties>expressions> check the box relative

2) Try a formula like sum(your_field)/sum(TOTAL your_field)

Hope that helps.

Matt