Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

match function

Hi,

I am stuck in one logic,please help me to resolve that issue.

I have two fact table which are link to each other with the help of key,some rows are not mapped due to key are missing in one table.

I want sales of those employee whose key are matched with each table.

Thanks in advance.

Regards,

Nisha

11 Replies
Anonymous
Not applicable
Author

sample data please

fashid
Specialist
Specialist

sample QVW please

Not applicable
Author

For example

Table1:

key Employee Name Sales

1 A 100

2 B 200

3 C 500

Table2:

key Dept Name Sales1

1 X 100

2 Y 200

3 Z 500

4 W 600

I want sum(Sales)=800 and Sum(Sales1)=800...means only 3 keys are match these two table, so it gives only those sales whose key are match.

arulsettu
Master III
Master III

Hi

concatenate the two fact tables it may be help

Anonymous
Not applicable
Author

Check if this is helps

Fact1:

LOAD * INLINE [

     Employee, Name, Sales,

1, A, 100

2, B, 200

3, C, 500

];

Fact2:

LOAD * INLINE [

    Dept, Name, Sales1,

1, X, 100

2, Y, 200

3, Z, 500

4, W, 600

];

Fact_Drop:

NoConcatenate

load

* Resident Fact1;

Right join

load

Dept as Employee,

Name as Name2,

Sales1

Resident Fact2;

drop tables Fact1,Fact2;

Additional_record_in_Fact2:

NoConcatenate

load

Employee as Dept,

Name2 as Name,

Sales1

Resident Fact_Drop

where Len(Sales)=0;

drop Table Fact_Drop;

Regards

Harsha

Not applicable
Author

I want that logic in sheet level.

fashid
Specialist
Specialist

SET ThousandSep=',';

SET DecimalSep='.';

SET MoneyThousandSep=',';

SET MoneyDecimalSep='.';

SET MoneyFormat='$#,##0.00;($#,##0.00)';

SET TimeFormat='h:mm:ss TT';

SET DateFormat='M/D/YYYY';

SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

Fact1:

LOAD * INLINE [

     Employee, Name, Sales,

1, A, 100

2, B, 200

3, C, 500

];

Concatenate

Fact2:

LOAD * INLINE [

    Dept, Name, Sales1,

1, X, 100

2, Y, 200

3, Z, 500

4, W, 600

];

use this

and then in front end chart sum(sales)

and sum(sales 1)

i have attached the app

Anonymous
Not applicable
Author

Hi Nisha

I managed to get the expression

please see wether it is helpfull

=if(match(ValueList($(=concat({1} distinct chr(39) & Employee & Chr(39),','))),ValueList($(=concat({1} distinct chr(39) & Dept & Chr(39),','))))=0,sum(Sales1),sum(Sales1)-(sum(Sales1)-sum(Sales)))

Regards

Harsha

Not applicable
Author

Hi Harsha,

I want to  make a chart in which Dept is in x-axis,I want sales for all department ,but whose key are matched with table 1 it will show that sum of sales else it show as it is which is in table 2.

Regards,

Nisha