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

Relative % in Pivot Table

I'm trying to get a relative % in a pivot table, but the following formula doesn't work:

-Sum({$<YEAR={$(=vYear)}, MONTH={$(=vMonth)}>} If(ACCTNUM=SUBACCT,ACTIVITY * PERCENTAGE/100))

/

-Sum(TOTAL {$<YEAR={$(=vYear)}, MONTH={$(=vMonth)}>} If(ACCTNUM=SUBACCT,ACTIVITY * PERCENTAGE/100))

It gives me the same results this formula, which ignores the set analysis:

-Sum(TOTAL If(ACCTNUM=SUBACCT,ACTIVITY * PERCENTAGE/100))

1 Solution

Accepted Solutions
jdmarlin
Contributor III
Contributor III
Author

Not sure what's happening but I've added set modifiers and the total divisor is being calculated properly now:

-Sum({$<YEAR={$(=vYear)}, MONTH={$(=vMonth)}>} If(ACCTNUM=SUBACCT,ACTIVITY * PERCENTAGE/100))

/

-Sum(TOTAL <ACCTNUM, SUBACCT> {$<YEAR={$(=vYear)}, MONTH={$(=vMonth)}>} If(ACCTNUM=SUBACCT,ACTIVITY * PERCENTAGE/100))

View solution in original post

1 Reply
jdmarlin
Contributor III
Contributor III
Author

Not sure what's happening but I've added set modifiers and the total divisor is being calculated properly now:

-Sum({$<YEAR={$(=vYear)}, MONTH={$(=vMonth)}>} If(ACCTNUM=SUBACCT,ACTIVITY * PERCENTAGE/100))

/

-Sum(TOTAL <ACCTNUM, SUBACCT> {$<YEAR={$(=vYear)}, MONTH={$(=vMonth)}>} If(ACCTNUM=SUBACCT,ACTIVITY * PERCENTAGE/100))