JustUser
JustUser

Reputation: 91

GT.M order values

is there any way how to sort the result set in GT.M by specific value?

Let's say I have global variable ^People(name,surname)=age and I want to get all the people with age between 20 and 40, ordered by their age?

Upvotes: 2

Views: 174

Answers (1)

FinrodFelagund
FinrodFelagund

Reputation: 207

Edit: Sorry to Answer instead of continuing the comment chain... my permissions level isn't high enough to comment on this question yet.

As long as you won't have multiple people with the same name, but different surnames, Yogesh is correct. It would be best to use the index to find the correct node of ^People, then grab what you need from ^People. But if you would have multiple people with the same name, but a different surname, then you would want to include the surname in the ^PeopleAgeIndex subnodes.

Upvotes: 1

Related Questions