Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Help with Ranked column (ranking based on IF statements in a loop)

Hi All, 

 

I'm trying to create a new ranked column based on a few if rules that need to be looped over. 

The data looks like this with the ApplicationCycle column being the desired ranked column: 

 

TABLE1

InteractionKey InteractionCourseTitleApplication Cycle
7Application madeMaster of Arts in Digital Asset and Media Management1
9Conditional OfferMaster of Arts in Digital Asset and Media Management1
7Application made6-week Combined Pre-sessional Programme2
15Firmly accpt offerMaster of Arts in Digital Asset and Media Management1
14EnrolledMaster of Arts in Digital Asset and Media Management1
21Reject6-week Combined Pre-sessional Programme2
7Application madePre-Sessional Course in English and Study Skills for Academic Purposes Stage 33
23Unconditional OfferPre-Sessional Course in English and Study Skills for Academic Purposes Stage 33
15Firmly accpt offerPre-Sessional Course in English and Study Skills for Academic Purposes Stage 33
8ATRdPre-Sessional Course in English and Study Skills for Academic Purposes Stage 33
14EnrolledPre-Sessional Course in English and Study Skills for Academic Purposes Stage 33
7Application madeMaster of Arts in Digital Asset and Media Management4
9Conditional OfferMaster of Arts in Digital Asset and Media Management4
8ATRdMaster of Arts in Digital Asset and Media Management4
15Firmly accpt offerMaster of Arts in Digital Asset and Media Management4
14EnrolledMaster of Arts in Digital Asset and Media Management4

 

So far, from my understanding the code should be something like this: 

 

ApplicationCycle=

Start LOOP from first unranked row in [ApplicationCycle] :
Foreach(row in [InteractionKey]): 
IF([InteractionKey]= "7") START RANKX (TABLE1 , [InteractionKey])
IF([InteractionKey]= "7") again SKIP RANKX
IF([InteractionKey]= " 6,10,21,24,14") STOP RANKX
End LOOP

 

 

Any advice, tips and pointers to this will be much appriciated.  

Thanks, 

1 REPLY 1
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

Could you please clarify what's the logic for the other InteractionKey Except the number "7, 6,10,21,24,14"?

77.png

 

Best Regards,

 

Amy

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.