字符串和数字 - 不匹配的聚合

String and Number - Mismatched Aggregation

我有这个table:

Genres             Episodes   

Drama                2
Drama                1
Drama                0
Comedy               2
Comedy               1
Comedy               0
Kids                 3
Kids                 2
Kids                 1
Kids                 0

我想创建一个计算字段:

Genres             Episodes            Criteria

Drama                2                  Complete
Drama                1                  Partial
Drama                0                  Obsolete
Comedy               2                  Complete
Comedy               1                  Partial
Comedy               0                  Obsolete
Kids                 3                  Complete
Kids                 2                  Partial
Kids                 1                  Partial
Kids                 0                  Obsolete

我的计算字段公式出现错误:

ifelse({Genres} = 'Drama' and (count({Episodes}) = 2), 'Complete',
{Genres} = 'Drama' and (count({Episodes}) = 0), 'Obsolete',
{Genres} = 'Drama' and (count({Episodes}) = 1), 'Partial',
{Genres} = 'Comedy' and (count({Episodes}) = 2), 'Complete',
{Genres} = 'Comedy' and (count({Episodes}) = 0), 'Obsolete',
{Genres} = 'Comedy' and (count({Episodes}) = 1), 'Partial',
{Genres} = 'Kids' and (count({Episodes}) = 3), 'Complete',
{Genres} = 'Kids' and (count({Episodes}) = 0), 'Obsolete','Partial')

错误:

Mismatched Aggregation. Custom Aggregations cannot contain both aggregate Count and non-Aggregated fields.

谁能帮我解决这个问题!

如果有人遇到这个聚合不匹配的问题,我找到了解决方法。

像我一样简单地将字符串转换成数字格式(公式):

genres_numbers:    

ifelse({Genres} = 'Drama',1, {Genres} = 'Comedy',2, 3)

其次,为剧集列创建一个count公式:

count_episodes:

count({Episodes})

然后,取两者的平均值并将标准值指定为:

ifelse(avg({genres_numbers}) = 1 and avg({count_episodes}) = 2, 'Complete'...)

这对我有用:)