Scratching my Head

Guys,

Whats wrong with this below,

   ORDERBY(

    SELECT(
      Machine Parts[Part Name],
      AND(
        OR(
          ISBLANK([_THISROW].[Part Catagory]),
          ([_THISROW].[Part Catagory] = [Part Catagory])
        ),
        ([_THISROW].[Machine Name] = [Machine Name])
      )
    )
    , [Part Name], false)

This works… Just trying to make more user friendly.

SELECT(
  Machine Parts[Part Name],
  AND(
    OR(
      ISBLANK([_THISROW].[Part Catagory]),
      ([_THISROW].[Part Catagory] = [Part Catagory])
    ),
    ([_THISROW].[Machine Name] = [Machine Name])
  )
)

Any Help would be appreciated.

It looks like you are trying to get a list of Part Names, sorted alphabetically, that match a selected Category and Machine Name.

What is the problem?

1 Like

Is [Part Name] a key?

1 Like

@Heru is right. ORDERBY() only works with Key columns.
ORDERBY( row-keys , sort-key [ , descending-order? [ , sort-column ] ]… )

1 Like

But, it seems that [Part Name] is a key, And this ORDERBY() expression is in the Valid_If within a Ref column.

Can you please try to put it in the Suggested values not in the Valid If ?

If Part Name is not the key column of the Machine Parts table, use SORT() instead of ORDERBY().

In the future, please be explicit about what the problem is rather than leaving us to guess.

2 Likes

Just wondering where you got this information? I don’t see it in the post anywhere.

After asking if [Part name] is a key, I notice that there is a detail post about this. Which is too complicated for me (at this time) to understand.