Chris J
Chris J

Reputation: 936

Set Analysis - Current year and previous financial periods

Trying to get the below code to run correctly, I want to get the sum of the field movement where the field GlYear is the same as what has been selected and the field GlPeriod is less than or equal to the period selected.

sum({$ <GlYear = {"{'1'} =$(=max(GlYear))"}, GlPeriod = {"{'1'} <=$(=max(GlPeriod))"}>}Movement)

I can't convert the two fields to dates as there are 16 financial periods within a year to be reviewed.

Upvotes: 0

Views: 1674

Answers (1)

The Budac
The Budac

Reputation: 1633

sum({$ <GlYear = {"$(=max(GlYear))"}, GlPeriod = {"<=$(=max(GlPeriod))"}>}Movement)

I'm not sure what you are trying to achieve with the {'1'}

My expression gives me this based on some quick test data

enter image description here

Tip it usually helps me figure out the set analysis by leaving the expression without a caption so that I can see the results of the $() expansion

Upvotes: 2

Related Questions