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

Pie chart unable to select item with NULL values?

People:

LOAD * INLINE [

    Name, Age

    Adam, 34

    Bonnie, 25

    Charlie, 56

    David, 34

    Eddy, 34

    Florence, 45

    Gale, 43

    Helen, 24

    Isabella, 37

    Jamie, 54

    Kelvin, 25

];

Children:

LOAD * INLINE [

    Child, Name

    Lyra, Adam

    Matt, Bonnie

    Norman, Bonnie

    Oliva, Eddy

    Peter, Isabella

    Qweenie, Helen

    Roger, Helen

    Steven, Jamie

    Umar, Jamie

    Victor, Jamie

    Walter, Kelvin

    Xavier, Kelvin

    Zeldar, Kelvin

];

With the above 2 tables, I created a Pie Chart to show ratio of people with kids vs people with no kids using a Calculated Dimension:

=if(len(Child) <> 0, 'People with Kids', 'People without Kids')


and Expression:

Count(DISTINCT Name)

Pie.png

However, I am able to filter people with kids by selecting on the Pie chart but not able to filter people with No Kids.

Anyone can help? Or have I approached this all wrong?

1 Reply
devarasu07
Master II
Master II

Hi,

Try like below,

People:

LOAD * INLINE [

    Name, Age

    Adam, 34

    Bonnie, 25

    Charlie, 56

    David, 34

    Eddy, 34

    Florence, 45

    Gale, 43

    Helen, 24

    Isabella, 37

    Jamie, 54

    Kelvin, 25

];

left join

//Children:

LOAD * INLINE [

    Child, Name

    Lyra, Adam

    Matt, Bonnie

    Norman, Bonnie

    Oliva, Eddy

    Peter, Isabella

    Qweenie, Helen

    Roger, Helen

    Steven, Jamie

    Umar, Jamie

    Victor, Jamie

    Walter, Kelvin

    Xavier, Kelvin

    Zeldar, Kelvin

];

Final:

load *,if(len(Child)<0 or IsNull(Child), 'People without Kids','People with Kids') as ChildStatus Resident People;

drop table People;

Capture.JPG