Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Not applicable

Set Analysis Child Selected, Sum of Parent Needed

Hello Set Analysis friends.

I come to you to today with a question about how to return the sum of a parent value when a child is selected first. 

The specific question is:

Using Set Analysis, how do I get the sum of the Region when I have explicitly selected the Store?

Context:  Client wants to perform store to region comparisons on data.  The client picks the store and as a result the Region the store belongs is possible.

I have a chart that shows the store sum and the region sum.  The store sum is 16 and the region sum is supposed to be 616.  However, that is not happening.

I'm attempting to use Set Analysis to solve the problem by stating the following

=SUM({$<UK_Store_Name-={},UK_Region={'$(=Concat(Distinct UK_Region,','))'}>} data)

If I do the above I get zero.

If I do the following:

=SUM({1<UK_Region={'$(=Concat(Distinct UK_Region,','))'}>} data)

I get the 616, but then my selections don't work anymore because I've placed a 1 to include everything.

So my question is:  Using Set Analysis, how do I get the sum of the Region when I have explicitly selected the Store?

Thank you for your help.

Jeff G

1 Solution

Accepted Solutions
Not applicable

Re: Set Analysis Child Selected, Sum of Parent Needed

Answered my own question:  After banging head against wall for another 10 minutes:

Thought I had tried this before and it didn't work.  But now it appears good.

jg

=SUM({$<UK_Store_Name=,UK_Region={'$(=concat(DISTINCT UK_Region,','))'}>} $(varAHToggle))

1 Reply
Not applicable

Re: Set Analysis Child Selected, Sum of Parent Needed

Answered my own question:  After banging head against wall for another 10 minutes:

Thought I had tried this before and it didn't work.  But now it appears good.

jg

=SUM({$<UK_Store_Name=,UK_Region={'$(=concat(DISTINCT UK_Region,','))'}>} $(varAHToggle))