Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dividing by a full amount with a calculated dimension

In the attached application I have broken out the "deduction" field by the different types and used a counting function to show the employees who have each type. Now, I would like to divide each count by the 'sEmployee_cd' count, but because the employees are limited by the deduction dimension it always comes out as one. If anyone has any suggestions for how to work around this please let me know. Any help you can offer will be greatly appreciated.

1 Solution

Accepted Solutions
sunny_talwar

Is this what you were looking for:

Capture.PNG

Dimension: Company (401K) (Just one expression, instead of 3 additional hidden dimensions)

Expressions:

1) #: Count({<Deduction = {'401K'}, sCompany_cd = e({<sCompany_cd = {'92', '93', '95', '97'}>})>}fDeductRate)

2) Total: Count(sEmployee_cd)

3) %: Count({<Deduction = {'401K'}, sCompany_cd = e({<sCompany_cd = {'92', '93', '95', '97'}>})>}fDeductRate)/Count(sEmployee_cd)

HTH

Best,

Sunny

View solution in original post

4 Replies
robert_mika
Master III
Master III

Not sure but try this

Count(fDeductRate)/Count(total sEmployee_cd)

Otherwise provide your deisred result

sunny_talwar

May be this:


Count(fDeductRate)/Count(TOTAL{<Deduction = {'401K'}, sCompany_cd = e({<sCompany_cd = {'92', '93', '95', '97'}>})>} sEmployee_cd)

If the output required is this:

Capture.PNG

Anonymous
Not applicable
Author

Robert,

That gives me the desired amount for the total : 755 / 3,146 = 23.40% , but the individual locations reflect their relationship to the total. Instead I need them to do the same Ex: MS = 150 / 609 = 24.63%. Any ideas on how to accomplish this?

sunny_talwar

Is this what you were looking for:

Capture.PNG

Dimension: Company (401K) (Just one expression, instead of 3 additional hidden dimensions)

Expressions:

1) #: Count({<Deduction = {'401K'}, sCompany_cd = e({<sCompany_cd = {'92', '93', '95', '97'}>})>}fDeductRate)

2) Total: Count(sEmployee_cd)

3) %: Count({<Deduction = {'401K'}, sCompany_cd = e({<sCompany_cd = {'92', '93', '95', '97'}>})>}fDeductRate)/Count(sEmployee_cd)

HTH

Best,

Sunny