This content has been marked as final. Show 7 replies
One way of doing what you want is to use a function rule in an Aggregate operator.
- Use FieldNumber as the grouping key field.
- In the aggregate function, store the FieldNumber value into the 'work' datascript table using a numeric index. That is, work[#work+1] = input.FieldNumber
- When all the records with the same FieldNumber value have been processed, the 'work' table will have an entry for each record. For example, for FieldNumber 1, there would be three elements in the 'work' table: key 1, value 1; key 2, value 1; key 3, value 1
- In the result function use the iterative return (http://community.qlik.com/docs/DOC-3251) to cycle through the 'work' table and emit a record for each element.
- Each emitted record will include two fields: FieldNumber and the key value from the 'work' table that will become the value of the Count field.
You should review the documentation for the Aggregate operator function rule.