Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Syntax

GROUPFIRST(<any>; order by any)

Description

This function returns a value in a group as specified by the ordered column's first value.

  • If the column used to order the group is a number, then the value used from the order column is the lowest number.
  • If the column used to order the group is a string, then the value used from the order column is the lowest number (in string form). If no numbers (in string form) are present, the first capital letter alphabetically is used. If no uppercase letters are present, the first lowercase letter alphabetically is used.
  • If the column used to order the group is a date, then the value used from the order column is the earliest date.

This is an aggregate function

Example

Given the following data:

Customer_NameItem
2535JonZamioculcas
2888MikeSpider Lily
2535JonDatura
2535JonDahlia
5788JonSnapdragon
2888MikeMarguerite
2535JonWindflower
2888MikeElephant's Ear
2535JonChinese Evergreen
5788JonBegonia
5788JonStarfish Plant
2535JonHare's Foot Fern
2535JonVenus Flytrap
3545MoniqueRed Flame Ivy

First create a group, using GROUPBY(#RawData!Customer_num), and GROUPBY(#RawData!Name).

Customer_Name
2535Jon
2888Mike
3545Monique
5788Jon

Using GROUPFIRST(#RawData!Item;#RawData!Order), you can return the first item ordered by each customer.

Customer_NameFirst_Item
2535JonZamioculcas
2888MikeSpider Lily
3545MoniqueRed Flame Ivy
5788JonSnapdragon



  • No labels