Skip to content

ITAB Aggregation #194

@mickrig

Description

@mickrig

I have the issue with ITAB Aggregation. I provided a solution, but I get a lot of unknown type errors.
2022-09-21 14_57_37-Exercism ITAB Aggregation

Please scroll the image all the way to the right to see the errors.

Locally on my environment the code works well.

METHOD perform_aggregation.

     aggregated_data = REDUCE aggregated_data(
                         INIT aggregated = VALUE aggregated_data(  )
                              data = VALUE aggregated_data_type(  )
                         FOR GROUPS <group_key> OF <wa> IN initial_numbers
                           GROUP BY <wa>-group ASCENDING
                         NEXT data = VALUE #(
                                group = <group_key>
                                count = REDUCE i( INIT count = 0
                                        FOR m IN GROUP <group_key>
                                        NEXT count += 1 )
                                sum = REDUCE i( INIT sum = 0
                                        FOR m IN GROUP <group_key>
                                        NEXT sum += m-number )
                                max = REDUCE i( INIT max = 0
                                        FOR m IN GROUP <group_key>
                                        NEXT max = nmax( val1 = max
                                                         val2 = m-number ) )
                                min = REDUCE i( INIT min = 1000000000
                                        FOR m IN GROUP <group_key>
                                        NEXT min = nmin( val1 = min
                                                         val2 = m-number ) )
                                average = data-sum / data-count )
                              aggregated = VALUE #( BASE aggregated ( data ) ) ).

  ENDMETHOD. 

Thanks for your support.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions