Page tree
Skip to end of metadata
Go to start of metadata

Syntax

GROUPLAST(<any>; order by any)

Description

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

  • If the column used to order the group is a number, then the value used from the order column will the highest number.
  • If the column used to order the group is a string, then the value used from the order column will be a lowercase letter starting with z and moving reverse alphabetically followed by uppercase letters reverse alphabetically. If no letters are present in the sting type, the value used will be the highest number.
  • If the column used to order the group is a date, then the value used from the order column will be the latest 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, e.g. GROUPBY(#RawData!Customer_num), and GROUPBY(#RawData!Name).

Customer_Name
2535Jon
2888Mike
3545Monique
5788Jon

 

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

Customer_NameLast_Item
2535JonVenus Flytrap
2888MikeElephant's Ear
3545MoniqueRed Flame Ivy
5788JonStarfish Plant

 

 

  • No labels