# App Development

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
cancel
Showing results for
Did you mean:
Contributor

## Measures for 2 dim - P&L Chart

I got a problem using P&L Chart. Could anyone kindly help?

1. The first column was created by valuelist, e.g. Gross Margin = Revenue + COGS.
2. The second dimension in this P&L Chart (A,B,C,D) is shown in the first row.
3. The measure is calculted by

pick(rowno(),
Sum({<ProfitLoss={'Revenue'}>}Amount),
Sum({<ProfitLoss={'COGS'}>}Amount),
Sum({<ProfitLoss={'Revenue','COGS'}>}Amount)....

The problem is the Revenue of A will be shown in the column of A. Under the column of B, I have COGS everywhere. (Please refer to the screenshot below).

What should I do to have the result like help document?

Many thanks!

Labels (1)
• ### P&L Chart

1 Solution

Accepted Solutions

@yali  You may need to modify your expression like below

pick(Match(valuelist('Revenue','COGS',....),'Revenue','COGS',......),
Sum({<ProfitLoss={'Revenue'}>}Amount),
Sum({<ProfitLoss={'COGS'}>}Amount),
Sum({<ProfitLoss={'Revenue','COGS'}>}Amount

... )

4 Replies

@yali  You may need to modify your expression like below

pick(Match(valuelist('Revenue','COGS',....),'Revenue','COGS',......),
Sum({<ProfitLoss={'Revenue'}>}Amount),
Sum({<ProfitLoss={'COGS'}>}Amount),
Sum({<ProfitLoss={'Revenue','COGS'}>}Amount

... )

Specialist

Just wondering the use of valuelist in this case. Not sure if you actually need it. You have below output if you use pivot table:

With below settings:

Contributor
Author

Thank you for your answer. But I need valuelist to create manuelly subsum (e.g. Revenue + COGS).

Contributor
Author