Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
valpassos
Creator III
Creator III

Two facts, different dimensions

Hi community

I've posted this question in a comment but maybe I will have more luck if I post it as a general question.

So, I have a fact table with everything concatenated into it. You can see a glimpse into my Customer and Warehouse values, and the facts they are producing.

(image deleted)

You can see that Fact2 is only at the level of the Warehouse, and Fact1 is at the level of both the Customer and the Warehouse.

My Customer and Warehouse values come in fact from the same column in the source table, but they produce different facts, and in the qlik script I'm just doing a WHERE filter on their ID code to know what is a Customer and what is a Warehouse, and them I'm joining them into one table.

The thing is, I have a situation where I need to have the Fact2 in the same line, associated with the Customer, because I need to compare these two facts in a scatter plot where I'm using Customer as a dimension. So, I need to have that 10 score in fact2 in every line for the same Warehouse but different Customer, as I've drawn in the image.

Can someone help me?

Thanks!,

Lisa

10 Replies
valpassos
Creator III
Creator III
Author

Hi Sunny,

I will give your solution a try. I eventually ended up getting the result I need by left joining the two tables this way:

Customer:

%ID

%ID_Warehouse

...

Fact1

FROM Source

WHERE %ID=... (code that gives me only Customers)

LEFT JOIN

Warehouse:

%ID              AS               %ID_Warehouse

Fact2

From Source

WHERE %ID=... (code that gives me only Warehouses)

Now I have Customer, Warehouse, Fact1 and Fact2 on the same line/record

Lisa