Qlik Community

QlikView Extensions

Discussion Board for collaboration on QlikView Extensions.

Highlighted
darrihilmarsson
New Contributor III

Total in an expression

Hi, QV

I have one problem that I don't know he solution.

I am seeing if you can figure it out.

I have this dataset. I have information of number of invoices for every category and company.

CompanyCategoriesNo. of invoices
1000Intercompany42787
1000Scanned17894
1100Emailed PDF3773
1100Scanned12608


I want to know e.g.

How many invoices in percentage are scanned for company 1000 of total invoices for company 1000.

The answer I am looking for is:

Scanned Invoices for company 1000/ Total Invoices for company 1000 = 17894/60681 = 29,4%

I tried to use this formula: =Sum([Number of invoices])/Sum(Total [Number of invoices])

But it does not give me the right answer because in the formula: Sum(Total [Number of invoices]

I get all the invoices.

1 Solution

Accepted Solutions

Re: Total in an expression

Use below expression

=Sum([Number of invoices])/Sum(Total <Company>[Number of invoices] )

4 Replies

Re: Total in an expression

Try this:

=Sum([Number of invoices] & Company)/Sum(Total <Company> [Number of invoices] & Company)


Capture.PNG

Re: Total in an expression

Use below expression

=Sum([Number of invoices])/Sum(Total <Company>[Number of invoices] )

Re: Total in an expression

You need to specify the company dimension in your TOTAL expression

  Sum([Number of invoices])/Sum(Total <Company> [Number of invoices])


Use this in a chart with Company as a dimension

MVP
MVP

Re: Total in an expression

replace

Sum([Number of invoices])/Sum(Total [Number of invoices])


with

Sum([Number of invoices])/Sum(Total  <Company> [Number of invoices])

because you want the total at the Company level