Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis - Including a specific value regardless of selection

Hi Experts,

This is how my data looks like:

ID_primaryID_aID_bData
ABCABC50
ABCDEFDEF100
ABCLMNLMN20
ABCXYZXYZ30
DEFDEF20
DEFABCABC50
DEFGHIGHI80

Notice the rows where ID_b = ID_primary. Also notice that where ID_b=ID_primary, ID_a=NULL. These may come in handy in understanding what I'm trying to achieve.

I then have a simple chart where Dimension is ID_b and Expression is Sum of Data.

User first selects a distinct ID_primary. For example user selects ABC. Chart will show ABC, DEF, LMN, XYZ.

User will then select one or many values from ID_a. For example, user selects LMN, XYZ. Chart will then update to show LMN, XYZ.

Objective: Regardless of what user selects from ID_a, I want ABC to show up on the chart. Basically I want to always show on the chart where ID_b = ID_primary. So if for example, user selects ID_primary=ABC and then selects ID_a=LMN,XYZ, I want the chart to show ABC,LMN,XYZ.

I have tried using set analysis on the chart expression:

sum({$+<ID_b=ID_primary>}Data)

The above does not work.

Since all rows where ID_b=ID_primary have a NULL value for ID_a, I then tried this:

sum({$+<ID_a=''>}Data)

The above did not work either.

Any suggestions? Attached QVW as example. Thanks!

1 Solution

Accepted Solutions
sunny_talwar

Try this

=Sum({<ID_b = p(ID_primary)+p(ID_a), ID_a>}Data)

View solution in original post

4 Replies
sunny_talwar

Try this

=Sum({<ID_b = p(ID_primary)+p(ID_a), ID_a>}Data)

Anil_Babu_Samineni

Like this?

Capture.JPG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anil_Babu_Samineni

So Fast

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful