Is there a way to simply add an item to an ANY() list?

Mike_T
New Member

Iโ€™ve got a list of column of โ€œStatesโ€. Iโ€™m using a detail view as a dashboard filter as described in this video: Dynamic Dashboards

Iโ€™m trying to allow the user to select a list of states but also always include the โ€œstateโ€ โ€˜ADโ€™. AD is the acronym for the total division. Essentially the data includes programs that are for AD and specific state programs. When the user selects a state or a couple of states this filter will return programs from AD + the selected states. Here is 1 part of my AND expression in the Slice filter:

IF(ISBLANK(ANY(QRManager Map[State Filter])), TRUE,[State] = ANY(QRManager Map[State Filter])),

How do I add AD to the list of states in the (QRManager Map[State Filter]) column?

Solved Solved
0 8 216
1 ACCEPTED SOLUTION

So this:

IF(ISBLANK(ANY(QRManager Map[State Filter])), TRUE,[State] = ANY(QRManager Map[State Filter] + {โ€œADโ€})),

is a slice row filter?

And QRManager Map[State Filter] refers to an EnumList column?

If yes to both, try this instead:

OR(
  ISBLANK(QRManager Map[State Filter]),
  IN([State], SPLIT((QRManager Map[State Filter] + {โ€œADโ€}), ","))
)

View solution in original post

8 REPLIES 8

Mike_T
New Member

Dang itโ€ฆ I thought I had it by adding an OR() around this expression
AND(
OR(IF(ISBLANK(ANY(QRManager Map[State Filter])), TRUE,[State] = โ€œADโ€),
IF(ISBLANK(ANY(QRManager Map[State Filter])), TRUE,[State] = ANY(QRManager Map[State Filter]))),โ€ฆ

This only returns AD + one of the other states selected.

Steve
Platinum 4
Platinum 4
QRManager Map[State Filter] + {"AD"}

See also:

IF(ISBLANK(ANY(QRManager Map[State Filter])), TRUE,[State] = ANY(QRManager Map[State Filter]) + {โ€œADโ€}),

gives me back an error:
Arithmetic expression โ€˜(ANY(QRManager Map[State Filter])+LIST(โ€œADโ€))โ€™ has inputs of an invalid type โ€˜Unknownโ€™

You didnโ€™t use what I suggested.

You are right! I moved the parentheses and the error goes away!

But have realized another issue. When I select multiple states, my filtered view only returns the first state in the list. When I clear the field the view shows all states and AD.

So this:

IF(ISBLANK(ANY(QRManager Map[State Filter])), TRUE,[State] = ANY(QRManager Map[State Filter] + {โ€œADโ€})),

is a slice row filter?

And QRManager Map[State Filter] refers to an EnumList column?

If yes to both, try this instead:

OR(
  ISBLANK(QRManager Map[State Filter]),
  IN([State], SPLIT((QRManager Map[State Filter] + {โ€œADโ€}), ","))
)

That Did It!!! I was wondering if it had something to do with those pesky commas!

Just so I understand what you did here. By using the SPLIT expression you essentially removed the commas from the list?

Yes and yes, This is a slice filter and I am using an Enum List in this column. For future reference, Enum List the part that doesnโ€™t like the commas? btwโ€ฆiโ€™m using Valid If field to generate my enum list.

Once again, Amazing Support from Appsheet!!!

Top Labels in this Space