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

Pie chart with percentage of matching field in two tables

Dear Community

I have a few beginners questions. Maybe I post them one by one?

1) I have two large tables with about 10 identical colums. They are the results of the logging of two different versions of a system. I want to find out the differences of the two versions.

So I want to know

- how many values (in percentage) in column A of table 1 are also found in column A of table2.

-  how many values in column A of table 1 are not found in column A of table2.

-  how many values in column A of table 2 are not found in column A of table1.

And I want to do the same taking into account that Column B has a specific value (It can have 3 possible values)

I appreciate your help with that.

1 Solution

Accepted Solutions
Anil_Babu_Samineni

I mean this?

Table1:
LOAD 'T1' as Flag, Signalname, Day, Time, Reason, Area From Table;

Table2:
Load 'T2' as Flag, Signalname, Day, Time, Reason, Area From Table;


@JJonker wrote:

- how many values (in percentage) in column A of table 1 are also found in column A of table2.

If(Only({<Flag={'T1'>} Signalname)=Only({<Flag={'T2'>} Signalname),  Num(Sum(Measure), '#,#0%'))

-  how many values in column A of table 1 are not found in column A of table2.

 If(Only({<Flag={'T1'>} Signalname)<>Only({<Flag={'T2'>} Signalname),  Num(Sum(Measure), '#,#0%'))

-  how many values in column A of table 2 are not found in column A of table1.

Similar to Second Question

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

View solution in original post

7 Replies
Anil_Babu_Samineni

Difficult to say without seeing data model?
- If you have flag from two tables then we can use

Do you want this in Script?
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
JJonker
Contributor
Contributor
Author

Ok some more information:

I read the table from a csv file, but can give an inline example

Table1:
LOAD *
INLINE [
Signalname, Day, Time, Reason, Area
OI1, 1,12:00,start,North
OI2, etc,
OI4, etc,
OI6, etc

..

OI12300,etc
];

Table2:
INLINE [
Signalname, Day, Time, Reason, Area
OI1, 1,12:01,Start,North,
OI3, etc,
OI4, etc,
OI6, etc

..

OI12253,etc
];

 

 

 

Anil_Babu_Samineni

You can play around using Flag for Table1 and Table2.

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
JJonker
Contributor
Contributor
Author

What do you mean with using Flag?
Anil_Babu_Samineni

I mean this?

Table1:
LOAD 'T1' as Flag, Signalname, Day, Time, Reason, Area From Table;

Table2:
Load 'T2' as Flag, Signalname, Day, Time, Reason, Area From Table;


@JJonker wrote:

- how many values (in percentage) in column A of table 1 are also found in column A of table2.

If(Only({<Flag={'T1'>} Signalname)=Only({<Flag={'T2'>} Signalname),  Num(Sum(Measure), '#,#0%'))

-  how many values in column A of table 1 are not found in column A of table2.

 If(Only({<Flag={'T1'>} Signalname)<>Only({<Flag={'T2'>} Signalname),  Num(Sum(Measure), '#,#0%'))

-  how many values in column A of table 2 are not found in column A of table1.

Similar to Second Question

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
JJonker
Contributor
Contributor
Author

Thanks for your suggestion.
Flagging is indeed the way to prepare things like this.
Anil_Babu_Samineni

Glad, We were able to help you.
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