# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save \$400 before Dec 31st: REGISTER NOW!
cancel
Showing results for
Did you mean:
Contributor II

## How do I calculate the ratio of a sum total by each number of rows.

Hello - I'm trying to add a column to the below table that is the % of the total in the 2nd column:

 Sub Class Growth \$ % of Total Growth GPT \$1,500 16% CRM \$2,500 26% Quantitative \$3,800 40% ID \$950 10% Custom \$850 9%

The 2nd column (Growth \$) is the following set analysis:

Sum({\$<Year={'2018'},
[Transaction Line Accounts Account Number]={404100},[Transaction Type]={'Invoice','Cash Sale','Cash Refund','Credit Memo', 'Bill', 'Journal'},
\$(vExcludeDateFields)>} [Transaction Line Gross Amount])
-
Sum({\$<Year={'2017'},
[Transaction Line Accounts Account Number]={404100},[Transaction Type]={'Invoice','Cash Sale','Cash Refund','Credit Memo', 'Bill', 'Journal'},
\$(vExcludeDateFields)>} [Transaction Line Gross Amount])

Can someone point in the right direction to adding the correct %'s in the 3rd column (% of Total)??

Labels (3)

• ### Set Analysis

1 Solution

Accepted Solutions
MVP

Try this

```RangeSum(
Sum({\$<Year = {'2018'},
[Transaction Line Accounts Account Number] = {404100},[Transaction Type] = {'Invoice','Cash Sale','Cash Refund','Credit Memo', 'Bill', 'Journal'},
\$(vExcludeDateFields)>} [Transaction Line Gross Amount]),
-Sum({\$<Year = {'2017'},
[Transaction Line Accounts Account Number] = {404100},[Transaction Type] = {'Invoice','Cash Sale','Cash Refund','Credit Memo', 'Bill', 'Journal'},
\$(vExcludeDateFields)>} [Transaction Line Gross Amount])
)
/
RangeSum(
Sum(TOTAL {\$<Year = {'2018'},
[Transaction Line Accounts Account Number] = {404100},[Transaction Type] = {'Invoice','Cash Sale','Cash Refund','Credit Memo', 'Bill', 'Journal'},
\$(vExcludeDateFields)>} [Transaction Line Gross Amount]),
-Sum(TOTAL {\$<Year = {'2017'},
[Transaction Line Accounts Account Number] = {404100},[Transaction Type] = {'Invoice','Cash Sale','Cash Refund','Credit Memo', 'Bill', 'Journal'},
\$(vExcludeDateFields)>} [Transaction Line Gross Amount])
)```

3 Replies
Partner - Master III

I am assuming you mean [value in column2]/[total of column2]

you need to use TOTAL qualifier. to put simply

your_expression divided by your_expression with total qualifier added

https://community.qlik.com/t5/Qlik-Design-Blog/What-does-the-TOTAL-qualifier-do/ba-p/1472990

MVP

Try this

```RangeSum(
Sum({\$<Year = {'2018'},
[Transaction Line Accounts Account Number] = {404100},[Transaction Type] = {'Invoice','Cash Sale','Cash Refund','Credit Memo', 'Bill', 'Journal'},
\$(vExcludeDateFields)>} [Transaction Line Gross Amount]),
-Sum({\$<Year = {'2017'},
[Transaction Line Accounts Account Number] = {404100},[Transaction Type] = {'Invoice','Cash Sale','Cash Refund','Credit Memo', 'Bill', 'Journal'},
\$(vExcludeDateFields)>} [Transaction Line Gross Amount])
)
/
RangeSum(
Sum(TOTAL {\$<Year = {'2018'},
[Transaction Line Accounts Account Number] = {404100},[Transaction Type] = {'Invoice','Cash Sale','Cash Refund','Credit Memo', 'Bill', 'Journal'},
\$(vExcludeDateFields)>} [Transaction Line Gross Amount]),
-Sum(TOTAL {\$<Year = {'2017'},
[Transaction Line Accounts Account Number] = {404100},[Transaction Type] = {'Invoice','Cash Sale','Cash Refund','Credit Memo', 'Bill', 'Journal'},
\$(vExcludeDateFields)>} [Transaction Line Gross Amount])
)```

Contributor II
Author
Thank you! Works perfectly!
Tags
Community Browser