Icon

KNIME_​test_​is_​subset

Treat column1 and column2 elements as twodifferent sets of data, which can then be compared(regardless of order) using a Joiner The joiner is only matching the elements, and not takingaccount of the number of occurrences, so one way to do this isto count the occurrences (which was done by the earlier groupby) and where the count of an element in column1 was greaterthan the count of the same element in column2, we add themhere to the list of "mismatches" The set of "mismatches" is joined back to the original set, so that we know whether each set contains a mismatch. After this join, the presenceof a value in ElementValue1 (populated from the "mismatches" table, will indicate that this is a mismatch by the susequent Rule Engine. Cell splitters are used to break comma-separated stringsinto "Lists".The Ungroup then turns those into individual rows (1 rowper element) We want to treat Column1 and Column2 as separate data sets, but give them a common "key"so that we know what we are comparing. So use Counter Generation to provide a key called"Counter" and then split the columns into twoso that they can be turned into sets for processing Sample dataalong with"expected result" fortesting at the endTurn column1into a listTurn column2into a listUse "counter" as anidentifier fororiginal row (needed later)Ungroup listsinto individual rowsFind where "Left"(top) tablerow cannot be joined to "Right" (bottom) tablefor a given "counter" numberMark those rows thatjoined to "mismatches" as"not subset", and those thatdidn't as "subset"tidy up columnsSort into original orderFind where "Left"(top) tablerow cannot be joined to "Right" (bottom) tablefor a given "counter" numberCount of each element ineach groupDuplicate "Element"from set 2Needed for GroupByCount of each element ineach groupDuplicate "Element"from set 1Needed for GroupByFind those rows with"too many" of a given elementThose with "too many"must be considered "not subsets"This is the "MISMATCH TABLE"Multiple "mismatches" will have resulted induplication when we joined back, so remove duplicatesUngroup listsinto individual rowsGet column2 dataas a tableGet column1 dataas a tableCheck the results against expected Table Creator Cell Splitter Cell Splitter Counter Generation Ungroup Joiner (Labs) Rule Engine Column Filter Sorter Joiner (Labs) GroupBy Rule Engine GroupBy Rule Engine Rule-basedRow Filter Concatenate DuplicateRow Filter Ungroup Column Filter Column Filter Rule Engine Treat column1 and column2 elements as twodifferent sets of data, which can then be compared(regardless of order) using a Joiner The joiner is only matching the elements, and not takingaccount of the number of occurrences, so one way to do this isto count the occurrences (which was done by the earlier groupby) and where the count of an element in column1 was greaterthan the count of the same element in column2, we add themhere to the list of "mismatches" The set of "mismatches" is joined back to the original set, so that we know whether each set contains a mismatch. After this join, the presenceof a value in ElementValue1 (populated from the "mismatches" table, will indicate that this is a mismatch by the susequent Rule Engine. Cell splitters are used to break comma-separated stringsinto "Lists".The Ungroup then turns those into individual rows (1 rowper element) We want to treat Column1 and Column2 as separate data sets, but give them a common "key"so that we know what we are comparing. So use Counter Generation to provide a key called"Counter" and then split the columns into twoso that they can be turned into sets for processing Sample dataalong with"expected result" fortesting at the endTurn column1into a listTurn column2into a listUse "counter" as anidentifier fororiginal row (needed later)Ungroup listsinto individual rowsFind where "Left"(top) tablerow cannot be joined to "Right" (bottom) tablefor a given "counter" numberMark those rows thatjoined to "mismatches" as"not subset", and those thatdidn't as "subset"tidy up columnsSort into original orderFind where "Left"(top) tablerow cannot be joined to "Right" (bottom) tablefor a given "counter" numberCount of each element ineach groupDuplicate "Element"from set 2Needed for GroupByCount of each element ineach groupDuplicate "Element"from set 1Needed for GroupByFind those rows with"too many" of a given elementThose with "too many"must be considered "not subsets"This is the "MISMATCH TABLE"Multiple "mismatches" will have resulted induplication when we joined back, so remove duplicatesUngroup listsinto individual rowsGet column2 dataas a tableGet column1 dataas a tableCheck the results against expected Table Creator Cell Splitter Cell Splitter Counter Generation Ungroup Joiner (Labs) Rule Engine Column Filter Sorter Joiner (Labs) GroupBy Rule Engine GroupBy Rule Engine Rule-basedRow Filter Concatenate DuplicateRow Filter Ungroup Column Filter Column Filter Rule Engine

Nodes

Extensions

Links