Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
rileymd88
Contributor III
Contributor III

Set Analysis With A Calculation

Hi All,

I have a problem trying to use the set analysis with a calculation include.

My Table is very simple:

ProductFY 1516 FlagBucket 1Bucket 2Bucket 3
10102030
21151010
31555

I would like to make the following calculation but only when the FY 1516 Flag is Set to "1":

=Sum([Bucket 1]) / Sum([Bucket 1] + [Bucket 2] + [Bucket 3])

When I try to do this using a Set Analysis it does not work, however it works if I only try to sum up Bucket 1

Working: Sum( {$<[FY 1516 Flag]={1}>} [Bucket 1])

Not Working: Sum( {$<[FY 1516 Flag]={1}>} Sum([Bucket 1]) / Sum([Bucket 1] + [Bucket 2] + [Bucket 3]))

Not Working: Sum( {$<[FY 1516 Flag]={1}>} [Bucket 1]) / ([Bucket 1] + [Bucket 2] + [Bucket 3]))

Can anyone help?

R

1 Solution

Accepted Solutions
maxgro
MVP
MVP

maybe also

Sum([Bucket 1]) / Sum([Bucket 1] + [Bucket 2] + [Bucket 3]) * [FY 1516 Flag]

View solution in original post

2 Replies
sunny_talwar

Try this:

=Sum({$<[FY 1516 Flag]={1}>}[Bucket 1]) / Sum({$<[FY 1516 Flag]={1}>}[Bucket 1] + [Bucket 2] + [Bucket 3])

maxgro
MVP
MVP

maybe also

Sum([Bucket 1]) / Sum([Bucket 1] + [Bucket 2] + [Bucket 3]) * [FY 1516 Flag]