Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
WEBINAR June 25, 2025: Build on Apache Iceberg with Qlik Open Lakehouse - REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
LuisGramillo
Partner - Contributor II
Partner - Contributor II

Field AS Division Indicator

Hi everyone,

I am currently working on a table which its total values are part of the field selections.
As a reduction, I have 3 main fields, Num, Divisor and Sales.

Num field contains the category to see on a table, Divisor field contains which of the category should be use as a denominator for a division and Sales contains the aggregation data.
Something like this:

Num, Divisor, Sales
A,      C        , 10
A,      C        ,  20
B,      C        ,  5
C,      C        ,  15
C,      C        ,   15

The table should show:
Num,Sum(Sales), %
A, 30, 100%
B, 5, 16%
C, 30, 100%

How can I achieve this?

There are more fields and I would display something else than Num but here is the main idea.

Labels (5)
3 Replies
Anil_Babu_Samineni

Not sure, how 100% you got? can't that be 46% for A? something like this?

Num(Sum(Sales) / Sum(TOTAL <Divisor> Sales), '##0%')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
LuisGramillo
Partner - Contributor II
Partner - Contributor II
Author

Thank you so much, I tried and almost worked.

In this case the % is the sum of sales compared to the Divisor Sum(Sales).

The formula you typed returned for every row (which I was not capable of generating), but a value that I do not identify as the total value.

The reason this table is in that structure is that there are multiple total rows on the data. The example I used just considers one total in the rows but there will be more rows.

Anil_Babu_Samineni

If you can explain how math working, that really helps for us to do some statistics. 

Anyway, It is been almost one month - I believe you have got the answer already, If so kindly close posting correct answer. 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful