简体   繁体   English

比较 Alteryx 中的两行,并只考虑其中的一个到进一步的步骤

[英]Comparing two rows in Alteryx and Consider only one to the further steps

I have a dataset with similar rows but except one column value will be different.我有一个具有相似行的数据集,但除了一列值会有所不同。 I want to consider a row with specific value in that column and use it in the further steps.我想考虑该列中具有特定值的行,并在进一步的步骤中使用它。

If you see the data there are rows with duplicate ID's and names but different Status.如果您看到数据,则存在具有重复 ID 和名称但状态不同的行。 How can I achieve this.我怎样才能做到这一点。

  1. If Id is same then consider only active status.如果 Id 相同,则仅考虑活动状态。
  2. If ID is different any status which is in the status column如果 ID 不同,则状态列中的任何状态

I have tried using multirow formula but was not achieving anything.我曾尝试使用多行公式,但没有取得任何成果。 Any help will be appreciated.任何帮助将不胜感激。 Thanks a lot非常感谢

数据

There several ways to do this.有几种方法可以做到这一点。 If "Active" is alphabetically the first of the possible statuses, the easiest way would be to sort on ID and Status;如果“活动”是按字母顺序排列的第一个可能状态,最简单的方法是按 ID 和状态排序; then run through the Unique tool and select ID there: it will uniquely select the first ID it sees, which will be the 'Active' one when there's an active case (due to the sort).然后通过 Unique 工具和 select ID 在那里运行:它将唯一地 select 它看到的第一个 ID,当有一个活动案例时,这将是“活动”的 ID(由于排序)。 If you don't want to trust "Unique" you could accomplish the same thing with the Sample tool to grab one item when grouped by ID: again due to the preceding sort, that will grab Active when it is present.如果您不想信任“唯一”,您可以使用 Sample 工具完成相同的操作,以便在按 ID 分组时抓取一个项目:再次由于前面的排序,当它存在时将抓取 Active。 (Aside: if your possible statuses are such that the sort trick won't work, simply create a new variable that will help you sort to 'Active' appearing first in a group-by-ID.) (此外:如果您的可能状态导致排序技巧不起作用,只需创建一个新变量,该变量将帮助您排序为“活动”,首先出现在按 ID 分组中。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 比较两个工作簿并删除匹配的行 - Comparing Two Workbooks and Deleting Matched Rows Pyspark:在识别列时具有相同值的两行......只想保留其中一行 - Pyspark: Two Rows With Same Value in Identifying Column ... Only Want to Keep One of Rows 比较两个列表并从一个列表中删除重复项 - Comparing two lists and removing duplicates from one 在Excel中的两列中搜索不同行中的重复项,然后在对单独列中的值求和时仅计算一行 - Search two columns in Excel for duplicates in different rows then only count one row when summing values in a separate column 如何只保留一条记录,但从两行中提取数据以获得唯一参考号 - How to retain only one record but extract data from several two rows for a unique reference number PHP脚本将两行添加到一个表 - PHP Script adding two rows to one table 如果两行包含至少一个匹配元素,如何从 pandas dataframe 中删除行 - how to remove rows from a pandas dataframe if two rows contains at least one matching element 从表中删除要考虑两个变量的重复项 - DELETE duplicates from table where there are two variables to consider 当最多两个​​(XXX)时,SQL仅选择一行 - SQL select only one row when there are two max (XXX) sql select查询通过比较日期删除行 - sql select query remove rows by comparing dates
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM