cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Filter Repeat Region by Two Conditions

SOLVED
Highlighted

Re: Filter Repeat Region by Two Conditions

Hi Doug,

 

I have a similar situation, but I need to use an OR condition in my filter. 

I want my BOM to include all assembly members (&rpt.level < 2) OR any sub-component with a custom parameter (&asm.mbr.BOM_DISPLAY == YES)

 

Do you know how I can accomplish this? Thank you!

 

Spencer

Highlighted

Re: Filter Repeat Region by Two Conditions

Please disregard - I was way over-complicating it. I just discovered the Flat/Rec Item button in the repeat region menu. It does exactly what I need. 

Highlighted

Re: Filter Repeat Region by Two Conditions

This solution is terrible for parameters that are non binary.  Why can't we simply use an "AND" expression for two conditions in a filter?

Allow me to give an example.  If I have a component family that has 5 styles (1,2,3,4,5) and 4 options (A,B,C,D)

Style == (1,2,3,4,5)

Option== (A,B,C,D)

If I want to create a table that filters out a few of them lets say all parts that are style 1 and have option A.   I have to create another parameter "DISPLAY" or whatever and create a complicated conditional relation to set various combinations. 

Display == 1A,    (if style ==1 and option==A) ...

1B 

1C

1D

2A 

2B

etc..

That seems like a ridiculous amount of work just to create a table that filters a table with 2 conditions.

Does anybody know a better way.  This seems like something that would be easy to program with an AND / OR statement in a filter.

Highlighted

Re: Filter Repeat Region by Two Conditions

To a limited extent you can actually use and and or statements.  For example:

  • AND across multiple lines that filter out anything starting with a 6 or a 7:
    • &asm.mbr.name != 6*
    • &asm.mbr.name != 7*
  • OR...on just one line...Only show P/Ns that start with a 6 or 7
    • &asm.mbr.name == 6*,7*

 

The method above also works with other attributes and even company attributes/parameters...like description, etc

 

The main problem I am running into is that the or method using commas all must be on one line, but only allows for so many characters on that line before it errors and won't accept the code at all.  Given this limitation, it seems that I need a way to express OR statements across multiple lines.  I may need to resort to creating an extra parameter in relations and then filter by that one (as I did create a test table that did this), however I would rather filtering stay in filtering, and relations stay in filtering...seems cleaner and easier to troubleshoot.

 

Does anyone know how to continue to the next line in repeat region filtering code?

Highlighted

Re: Filter Repeat Region by Two Conditions

Another problem I run into using the above method is that I don't know how to adapt it to use multiple parameters on the OR line (for example if I wanted to filter by description OR P/N OR etc).

 

Also, the other reason I don't want to do filtering in the relations is that wildcards very much complicate the coding.  For example, if I wanted to filter by *BACK*UP* to account for BACKUP and BACK-UP, I think that would have to be done with 2 search functions and a nested if statement...now if I wanted to throw AND functions in there it would turn a one line filter into many lines...unless I am missing something.

Announcements
Business Continuity with Creo: Learn more about it here.