GROUPLAST

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 is the highest number.
  • If the column used to order the group is a string, then the value used from the order column is 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 is the highest number.
  • If the column used to order the group is a date, then the value used from the order column is the latest date.

This is an aggregate function. 

Example

Given the following data:

Customer_

Name

Order

Item

2535Jon101544Zamioculcas
2888Mike101567Spider Lily
2535Jon101643Datura
2535Jon101899Dahlia
5788Jon102003Snapdragon
2888Mike102248Marguerite
2535Jon102282Windflower
2888Mike102534Elephant's Ear
2535Jon102612Chinese Evergreen
5788Jon102617Begonia
5788Jon102765Starfish Plant
2535Jon102947Hare's Foot Fern
2535Jon103001Venus Flytrap
3545Monique103006Red Flame Ivy

First create a group using GROUPBY(#RawData!Customer_), 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