Forum Discussion

WBarberena's avatar
WBarberena
Frequent Visitor
5 months ago
Solved

Table.Skip won't work with Text.Contains?

Greetings,

 

I hope there is an easy solution I am missing, but here is my quandry:

 

Table.Skip(Source, each [Column1] <> "UNIT:10917") will remove records before row 7 and this is what I want.  The table needs to start at the UNIT record and include all subsequent records.   The problem is in the future the source will eventually yield different unit numbers and the query will break.  Also, the UNIT record may not always be in the same row, so I need the solution to be dynamic.

 

For some reason Table.Skip(Source, each Text.Contains([Column1], "UNIT:")) doesn't work.  The step actually does nothing to the query and does not yield an error.  Am I missing syntax?

 

I know extracting the text range to a new column and using that one will work, but I want to see if I can do this in one step.  I also know the syntax above will work with Table.SelectRows but that will remove all other rows and I just need to skip down to the designated one.

 

Thank you in advance.

  • HI WBarberena 

    I believe you need to negate the condition:

    Table.Skip(Source, each not Text.Contains([Column1], "UNIT:"))

    From the Table.Skip documentation:

    "the rows that meet the condition will be skipped until a row does not meet the condition."

     

    Does that work as intended?

2 Replies

  • HI WBarberena 

    I believe you need to negate the condition:

    Table.Skip(Source, each not Text.Contains([Column1], "UNIT:"))

    From the Table.Skip documentation:

    "the rows that meet the condition will be skipped until a row does not meet the condition."

     

    Does that work as intended?