Forum Discussion
BettyBike4731
Jan 11, 2023Copper Contributor
IIF Statement for a 1:M
Hi, First time poster: My data table has a 1:M relationship and I want to qry the highest level of 'color' Red is Highest; Green Lowest ID Color 1 Red 1 Green 1 Yel...
- Jan 12, 2023
you create a table (on demo ColorT) and input the colors in Ascending orders.
then create a Query (FinalQuery) that will output your result.
see the attached demo
arnel_gp
Steel Contributor
you create a table (on demo ColorT) and input the colors in Ascending orders.
then create a Query (FinalQuery) that will output your result.
see the attached demo
BettyBike4731
Jan 12, 2023Copper Contributor
Thanks arnel_gp
I had thought of that, but really just wanted to run in a single sort. I'll keep plugging
I had thought of that, but really just wanted to run in a single sort. I'll keep plugging
- George_HepworthJan 12, 2023Silver ContributorI didn't review Arnel's suggestion, but I'm sure it's the most appropriate. Table driven solutions (like the ColorT with an explicit designation of the ranking of colors) tend to be the most efficient.
Keep in mind that there is no inherent way to rank colors. That's an entirely subjective evaluation and subject to change at any time. Today you want Red to be highest, but there's no logical reason it can't become the lowest ranking as a result of some sort of change to your business rules. Don't give up on a good solution while searching for a chimerical one.