Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
rileymd88
New Contributor II

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

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Set Analysis With A Calculation

maybe also

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

2 Replies

Re: Set Analysis With A Calculation

Try this:

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

MVP
MVP

Re: Set Analysis With A Calculation

maybe also

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

Community Browser