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: 
upaliwije
Creator II
Creator II

P&L account

I have data in a table as follows

DescriptionDeptClassMonthAmount
SalesA111000
SalesB221000
SalesC132000
SalesD143000
SalesE354000
SalesF465000
SalesA131000
SalesB241000
SalesC142000
SalesE134000
SalesF135000
PURCHASEA11600
PURCHASEB224000
PURCHASEC131000
PURCHASED141500
PURCHASEE352400
PURCHASEF463100
PURCHASEA13800
PURCHASEB24750
PURCHASEC143000
PURCHASEE132000
PURCHASEF131000
Staff ExpA11600
Staff ExpB221000
Staff ExpC13100
Staff ExpD14400
Staff ExpE35300
Staff ExpF46100
Staff ExpA13800
Staff ExpB24750
Staff ExpC14250
Staff ExpE13100
Staff ExpF13500
Other ExpA11250
Other ExpB22300
Other ExpC13300
Other ExpD14300
Other ExpE35300
Other ExpF46300
Other ExpA13300
Other ExpB24300
Other ExpC14300
Other ExpE13400
Other ExpF13350

I want to prepare a P& L account in the following format using above data. Pls help me to prepare a data model and QV Documnt

P & L Account
DescriptionAmount
Sales29000
Less Purchase20150
Staff Exp4900
Other Exp3400
Total Exp8300
Profit550
4 Replies
julian_rodriguez
Partner - Specialist
Partner - Specialist

Hello Upali,

May be your problem is to sort on a "non alphabetically" way?

Please see the Sort tab, on the example attached...

20140702-1.JPG.jpg

Regards

its_anandrjs

Try to load your table like

LOAD Description,

     Dept,

     Class,

     Month,

     Amount

FROM

[RawData.xlsx]

(ooxml, embedded labels, table is Sheet1);

And then take the Pivot table and add the expressions

Label Sales -> sum({<Description={'Sales'}>} Amount)

Label Less Purchase -> sum({<Description={'PURCHASE'}>} Amount)

Label Staff Exp -> sum({<Description={'Staff Exp'}>} Amount)

Label Other Exp -> sum({<Description={'Other Exp'}>} Amount)

Label Total Exp -> sum({<Description={'Staff Exp'}>} Amount) + sum({<Description={'Other Exp'}>} Amount)

Label Profit -> sum({<Description={'Sales'}>} Amount) -

                     sum({<Description={'PURCHASE'}>} Amount) -

                    (sum({<Description={'Staff Exp'}>} Amount) +

                     sum({<Description={'Other Exp'}>} Amount))

And you get table like:-

PL-Pivot.png


Note:- I use your data as excel file you use your format.


Regards

upaliwije
Creator II
Creator II
Author

Thanks Andan

Can U pls upload the QVW document you prepared

engr_farhanqadr
Creator
Creator

Hi Upali,

I agree with the steps of Anand, but there is one more step which is involved for getting your desired shape of table , once you done with the adding of expression you will get all column shown in horizontal way, you have to drag the column to below the first column. attached is the developed file.

Thanks.

Farhan