Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
GHasan
Contributor III
Contributor III

Set Analysis

Hi, 

Can anyone help me with set analysis/expression (not load script)? 

Table A                                      Table B
   Col A                                          Col B                        
       1                                                 1
       2                                                  -
       3                                                 3
       4                                                  -

I want to List all the values from Table A, Col A that exists/ does not exist in Table B, Col B

Result 1: List all the values that exists

Result Table
Result Col
        1
        3


Result 2: List the values that does not exist 

Result Table
Result Col
        2
        4


Thanks in advance.

Labels (4)
3 Replies
BrunPierre
Master
Master

Maybe these

Exists

Aggr(Only({1<[Col A]={"=[Col B]"}>}[Col A]),Dimension)

Does not Exist

Aggr(Only({1<[Col A]-={"=[Col B]"}>}[Col A]),Dimension)

GHasan
Contributor III
Contributor III
Author

Thanks for your reply. Really appreciate it. 

Also, 

if I create a calculated field/measure, can I use it as a filter? Like if I create a new column with set analysis saying if col B is Null then Group A and if col b is not null the Group B.

Table A                                                   Table B
   Col A                                          Col B              Col C                        
       1                                                 1                    Grp B
       2                                                  -                    Grp A
       3                                                 3                    Grp B
       4                                                  -                    Grp A

FilterPane
    Grp A
    Grp B

Can I use this logic in a filter pane where it would show group A and group B as selectable filters and if I select Grp B it would limit col B to 1 & 3 only? Can I use a measure as a filter?

Thanks in advance.

BrunPierre
Master
Master

Certainly! If two conditions are mutually exclusive, that is, if one is true, the other must be false, use an if/else statement. Something like this can be used in charts and as selectable filters.

 

If(Len(Tim([col B]))= 0 or [col B]=' ' or [col B]='-', 'Group A', 'Group B')