GROUPMAP
Syntax
Description
Creates a JSON map based on two columns of all records within a group, keys, and values.
This is an aggregate function.Â
Example
Given the following data:
Customer_ | Name | Item |
---|---|---|
2535 | Jon | Zamioculcas |
2888 | Mike | Spider Lily |
2535 | Jon | Datura |
2535 | Jon | Dahlia |
5788 | Jon | Snapdragon |
2888 | Mike | Marguerite |
2535 | Jon | Windflower |
2888 | Mike | Elephant's Ear |
2535 | Jon | Chinese Evergreen |
5788 | Jon | Begonia |
5788 | Jon | Starfish Plant |
2535 | Jon | Hare's Foot Fern |
2535 | Jon | Venus Flytrap |
3545 | Monique | Red Flame Ivy |
First create a group using GROUPBY(#RawData!Name)
Name |
---|
Jon |
Mike |
Monique |
Then use the GROUPMAP(#RawData!Item;#RawData!Customer_), and the result is a JSON map based on your two column records in relation to the GROUPBY() column.
Name | |
---|---|
Jon | {"Zamioculas":2535,"Datura":2535,"Dahlia":2535,"Snapdragon":5788,"Windflower":2535,"Chinese Evergreen":2535,"Begonia":5788,"Starfish Plant":5788,"Hare's Foot Fern":2535,"Venus Flytrap":2535} |
Mike | {"Spider Lily":2888,"Maguerite":2888,"Elephant's Ear":2888} |
Monique | {"Red Flame Ivy":3545} |