Forum Discussion
Fuzzy Logic in PQ
Dear Experts,
I want to create below table from the Table-1 & Table-2 as shown:-
But when I used the merge query , the below option I can get "Ok" Activated as below, what could be missing from my side?
Attached is the worksheet ,
Br,
Anupam
3 Replies
- SergeiBaklanDiamond Contributor
Just in case here Creating a Crossjoin (All Combinations) in Power Query (gorilla.bi) are two cross join methods - one is faster, another one is easier.
Sample has nothing common with fuzzy logic. However, when needed we may imitate it for cartesian products, one of samples is in the comment to this post Cartesian Product Joins (for the Excel person) - Excelguru
- peiyezhuBronze Contributor
The Cartesian Product
Trying to return data from two or more tables without any joins creates what is called a "Cartesian product." A Cartesian product is defined as all possible combinations of rows in all tables. Be sure you have joins before trying to return data, because a Cartesian product on tables with many records and/or on many tables could take several hours to complete. The following is a Cartesian product as used on the two example tables; note that this table is only 3 records times 3 records, which yields a total of 9 records. However, imagine if instead, the table was 100 records times 1,000 records times 10,000 records; then the table would contain 1,000,000,000 records!
Join_Field Join_Field Color_Field Pattern_Field
1 2 Red Striped
1 3 Red Checkered
1 4 Red Polka-Dot
2 2 Blue Striped
2 3 Blue Checkered
2 4 Blue Polka-Dot
3 2 Green Striped
3 3 Green Checkered
3 4 Green Polka-Dot
Occasionally, some users want to use a Cartesian product; however, most users who get them do so accidentally, and are often confused by them. Because most users exclude most of the fields in a join, a real Cartesian product can easily look as perplexing as this:
Color_Field
Red
Red
Red
Blue
Blue
Blue
Green
Green
Green
If 100 records are added to Pattern_Table, this query would have 309 records (103 records each of Red, Blue, and Green).
Cartesian products have relatively simple SELECT statements. The following is how the SQL might look for the above Cartesian product:
SELECT Color_Table.Color_Field, Pattern_Table.Pattern_Field
FROM `c:\database`.Color_Table, `c:\database`.Pattern_Table