web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Selection or filter issue

(0) ShareShare
ReportReport
Posted on by 229

Hi guys, 

I got some issue on selection statement in grid.

My business context is for some training bootcamp, the training school offer 3 licence level : platinum (highest) - gold (middle) - silver 

Student got to choose many courses, some courses are Platinum, Gold or Silver.

In fact, if student choose one course only in all his choices with Platinum licence level (even the other are all Gold or Silver) the final licence level to pay will be Platinum and so on.

Number | Courses                         | Licence level

1            | Machine Learning         | Gold

2            | Deep Learning              | Platinum

3           | Data analyze                   | Silver

5            | Reinforcement Learning | Platinum

 

The grid will look like this one.

How could i work with select statement or another way to filter to keep only the highest level for each student ?

Thanksfully.

I have the same question (0)
  • AnithaEswaran Profile Picture
    2,032 on at

    hi,

    Do you mean that every student should be assigned only to Platinum by default?

  • Awaxx Profile Picture
    229 on at

    hi  AnithaEswaran 

    The bill for the training package will be made on Platinum if only one course with platinum licence is chosen.

    And the same if one Gold courses is chosen, even the other are all silver.

    Regards

  • Martin Dráb Profile Picture
    237,789 Most Valuable Professional on at

    How do you store Licence level? If it's an enum and values are sorted in the right way, you can simply use maxOf aggreation function.

    For example:

    while select StudentId from studentCourse
    	group by studentCourse.StudentId
    	join maxOf(LicenseLevel) from course
    		where course.Id == studentCourse.CourseId
    {
    }

  • Awaxx Profile Picture
    229 on at

    Hi goshoom

    To store licence level i got an enum, values are :

    0 None

    1 Platinum

    2 Gold

    3 Silver

    With the maxOf in your example, i will have the maximum of a licence appearence in my data, but in my context it will not works, cause for example if i get only ONE course with "Platinum level" i need to give this user the pricing for PLATINUM license even if there's a hundred courses with GOLD or SILVER level.

    I dont know if i explained it correctly

    Maybe if i count each licence level and look if there 0 or >=1 ?

    Thanksfully.

  • Verified answer
    Martin Dráb Profile Picture
    237,789 Most Valuable Professional on at

    I said that this solution is applicable if "values are sorted in the right way". Now you have two options:

    1. Either you can change the enum to support what you need.
    2. Or you can't use such a simple solution and you'll need something more complex. But maybe it won't be that difficult. You never mentioned None before. What is its purpose? Can't you simply exclude it? If you can, you'll add one where condition and that's it.

    Note that I don't understand what problem you have with "i get only ONE course with "Platinum level" i need to give this user the pricing for PLATINUM license even if there's a hundred courses with GOLD or SILVER level". I understand this requirement and I believe that it's what my solution does. Where do you see a problem (apart from the case of None license)? Maybe the key is in your statement "i will have the maximum of a licence appearence in my data", which isn't precise. It'll give you the highest license level for each student.

  • Awaxx Profile Picture
    229 on at

    The option 1 will do the job and its the easiest way for me. Thank you again Martin.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 663 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 540 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 348 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans