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.

0 8 280
8 REPLIES 8

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?

Is [Part Name] a key?

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

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 ?

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.

Steve
Platinum 4
Platinum 4

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.

Top Labels in this Space