Hey guys,
I have two tables. Table1 has an ID Column which looks like following for example:
Table1_ID |
1 |
3 |
5 |
6 |
. Then I have a second Table2 which looks as following:
Table2_ID | Size | Weight | ... | ... |
1 | ... | ... | ... | ... |
2 | ... | ... | ... | ... |
3 | ... | ... | ... | ... |
4 | ... | ... | ... | ... |
5 | ... | ... | ... | ... |
6 | ... | ... | ... | ... |
7 | ... | ... | ... | ... |
.
Now i want to filter Table2 with the ID Column of Table1, the output should look like following:
Table2_ID | Size | Weight | ... | ... |
1 | ... | ... | ... | ... |
3 | ... | ... | ... | ... |
5 | ... | ... | ... | ... |
6 | ... | ... | ... | ... |
. I would be thankful for your help.
Best regards,
Phil
Solved! Go to Solution.
Thank you for your help, it worked with following:
ForAll(Table2; If(ID in Table1.ID; Collect(MyCollection; ThisRecord)));;
You can use a collection and then add columns. Try something like this:
ClearCollect(MyCollection,
AddColumns(Table1,
"Size",Lookup(Table2,Table2_ID = Table1_ID).Size,
"Weight", Lookup(Table2,Table2_ID = Table1_ID).Weight
)
)
Thank you for your answer. I have much more columns except from "Size" and "Weight" (these are indicated by the dots ... in the table) . Does this mean I have to write each column explizitely in the formula as you did above?
Isn't there a way to write it like following:
Filter(Table2, Table2.Table2_ID = Table1.Table1_ID) ?
I guess this can be another way,
Clear(MyCollection);
ForAll(Table1,
Collect(MyCollection, Lookup(Table2,Table2ID = Table1ID))
)
Thank you for your help, it worked with following:
ForAll(Table2; If(ID in Table1.ID; Collect(MyCollection; ThisRecord)));;
User | Count |
---|---|
121 | |
88 | |
88 | |
75 | |
66 |
User | Count |
---|---|
215 | |
180 | |
138 | |
96 | |
82 |