
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Set Analysis - First Sorted Value inside the operator
Hi Everyone
I have made an example of what I am trying to do between 2 tables. Not sure what I'm doing wrong.
I am ultimately trying to retrieve the Txt, for the last available rule, per member. The tables were ordered in Load script.
The =FirstSortedValue(RuleID,-dteEffectiveDate) works fine and brings in the right ruleID.
Now to go a step further I want to bring in the text so I have tried using the relevant RuleID in the set analysis, with an aggregation and it doesn't seem to bring in the right text? I also changed the '-' and used Minstring etc but looks like it is something else I am missing here.
AGGR(
MaxString
(
{<RuleID = {"=FirstSortedValue(RuleID,-dteEffectiveDate)"}>}
Txt
)
,MemberID)
- Tags:
- aggr()
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
please check the attached
i have used similar exp : FirstSortedValue(Txt,-dteEffectiveDate)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I also tried this, which consistently gives now the First Text, not the last.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Anushree1
I will attach a QS app file with the example.
What I am trying to achieve is:
Member | Rule | Txt |
1 | 5 | bal |
2 | 13 | ybndfv |
3 | 20 | advrabbd |
Rule is the "latest" applicable rule for the member. That calc is working. Txt which I cannot get right is the Txt column for the last rule for the member.
I hope that helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be simply:
=FirstSortedValue(Txt,-dteEffectiveDate)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
please check the attached
i have used similar exp : FirstSortedValue(Txt,-dteEffectiveDate)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
