Skip to main content
16-Pearl
March 24, 2021
Solved

Infotable Aggregate with Strings

  • March 24, 2021
  • 1 reply
  • 1873 views

Dear community,

 

I would like to use aggregation on string values, comparable to other languages, e. g. SQL. Easy example of an Infotable:

 

myKey stringValue
1 "mx"
2 "my"
2 "mz"

 

Any chance I can use the Aggregate function (or anything else) to get

 

myKey stringValue
1 "mx"
2 "my"

 

with "my" as the first or minimum value?

 

Thank you

Benny

Best answer by PaiChung

I would filter first on the String column and create a new 'grouping column' then do the aggregate with grouping

1 reply

22-Sapphire I
March 24, 2021

Maybe some combination of a Query/Filter and Sort or Distinct

Check the Infotable functions

BennyB16-PearlAuthor
16-Pearl
March 25, 2021

Thanks for your reply @PaiChung .

 

I guess I broke my example down too much. I do have more columns which indeed need a sum aggregation. But if I cannot process the string column Aggregate is not useful for me. So here my extended example closer to reality:

 

myKey numValue stringValue
1 4 "mx"
2 5 "my"
2 6 "mz"

 

Desired output:

 

myKey numValue stringValue
1 4 "mx"
2 11 "my"

 

I have the feeling I need to iterate manually.

 

Thank you

Benny

PaiChung22-Sapphire IAnswer
22-Sapphire I
March 25, 2021

I would filter first on the String column and create a new 'grouping column' then do the aggregate with grouping