cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to community-mailer@ptc.com. Learn more.

Infotable Aggregate with Strings

bbeuckSIG
15-Moonstone

Infotable Aggregate with Strings

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

1 ACCEPTED SOLUTION

Accepted Solutions
PaiChung
22-Sapphire I
(To:bbeuckSIG)

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

View solution in original post

4 REPLIES 4
PaiChung
22-Sapphire I
(To:bbeuckSIG)

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

Check the Infotable functions

bbeuckSIG
15-Moonstone
(To:PaiChung)

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

PaiChung
22-Sapphire I
(To:bbeuckSIG)

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

bbeuckSIG
15-Moonstone
(To:PaiChung)

Thank you @PaiChung ,

 

I haven't tested your approach but since there is no other suggestion I accept it as my solution.

 

Perhaps I will create an entry in the ideas section to support strings with the Aggregation.

 

Thank you

Benny