Test Data Manager

  • 1.  TM Custom Filters RegExp

    Broadcom Employee
    Posted Jan 23, 2017 11:55 AM

    Hi,

     

    How do you use reg expressions in TDM Custom filters?

    What are the Functions? What are the Columns?

     

    Documentation is lacking!

     

    Example,

    We wish to create a custom filter to find any Table with "STRING" in?

     

    Ta

     

    Mark



  • 2.  Re: TM Custom Filters RegExp

    Posted Jan 23, 2017 01:26 PM

    Hi Mark, 

     

    Are you referring to this documentation? 

    Custom Filter Functions for Transformation Maps - CA Test Data Manager - 4.0 - CA Technologies Documentation 

    Verify Information Using a Filtered Sample - CA Test Data Manager - 4.0 - CA Technologies Documentation 

     

    It gives a list of functions in the documentation. Were none of the ones listed helpful?

     

    If you would like to provide feedback on the documentation, please post a comment on the documentation page:

     

    Best regards,

    Taylor



  • 3.  Re: TM Custom Filters RegExp

    Broadcom Employee
    Posted Jan 24, 2017 06:34 AM

    Gill,

     

    Hi,

     

    Yes very, but I was looking at older versions etc. Do you ghave any examples of how you would search all the fields in all tables for a string? For instance?

    Also regular expression ub user filters on the data profiling ?

     

    Many thanks

     

    Mark



  • 4.  Re: TM Custom Filters RegExp
    Best Answer

    Posted Jan 24, 2017 10:25 AM

    Hi Mark, 

     

    Since you have a support case open for filtering we can further work on this through that medium. I will post the resolution to here once the support case is closed. 

     

    Resolution:

     

    There is currently a defect open to fix the filter on the seedlist filter in Datamaker. If you wanted to use this feature, a workaround is to use custom filters.

     

    The maximum of distinct values should  depend on the table and column being profiled.

    For example, assume that columnA in tableA has 5000 distinct values and I want to create a custom filter with the string ‘Mummy and Daddy’.

    We should use 5000, rather than the default of 50.

     

     

    Doing this resolved Mark's issue.

     

    The custom filter is limited as it would only allow you to filter based on the data that is shown on the transformation map.

    In the below example, we provided you with the mappings between 'Column Name' as seen in the main transformation map and the corresponding name like 'tcd_datatype'.

     

    So we have the following:

     

    We want to keep nvarchar types:

     

    So we end up with:

     

     

    Best regards,

    Taylor



  • 5.  Re: TM Custom Filters RegExp

    Posted Feb 01, 2017 01:01 PM

    kusterer, Maybe this can be added to the documentation? 



  • 6.  Re: TM Custom Filters RegExp

    Posted Feb 02, 2017 09:46 AM

    The regex used by powerbuilder technology is very limited. It would not allow case insensitive search.

     

    Here are the details…

     

     

    Metacharacter

    Meaning

    Example

    Caret (^)

    Matches the beginning of a string

    ^C matches C at the beginning of a string.

    Dollar sign ($)

    Matches the end of a string

    s$ matches s at the end of a string.

    Period (.)

    Matches any character

    . . . matches three consecutive characters.

    Backslash (\)

    Removes the following metacharacter's special characteristics so that it matches itself

    \$ matches $.

    Character class (a group of characters enclosed in square brackets ([ ]))

    Matches any of the enclosed characters

    [AEIOU] matches A, E, I, O, or U.

    You can use hyphens to abbreviate ranges of characters in a character class. For example, [A-Za-z] matches any letter.

    Complemented character class (first character inside the brackets is a caret)

    Matches any character not in the group following the caret

    [^0-9] matches any character except a digit, and [^A-Za-z] matches any character except a letter.

     

     

    Metacharacter

    Meaning

    Example

    * (asterisk)

    Indicates zero or more occurrences

    A* matches zero or more As (no As, A, AA, AAA, and so on)

    + (plus)

    Indicates one or more occurrences

    A+ matches one A or more than one A (A, AAA, and so on)

    ? (question mark)

    Indicates zero or one occurrence

    A? matches an empty string ("") or A

     

    This pattern

    Matches

    AB

    Any string that contains AB; for example, ABA, DEABC, graphAB_one

    B*

    Any string that contains 0 or more Bs; for example, AC, B, BB, BBB, ABBBC, and so on

    AB*C

    Any string containing the pattern AC or ABC or ABBC, and so on (0 or more Bs)

    AB+C

    Any string containing the pattern ABC or ABBC or ABBBC, and so on (1 or more Bs)

    ABB*C

    Any string containing the pattern ABC or ABBC or ABBBC, and so on (1 B plus 0 or more Bs)

    ^AB

    Any string starting with AB

    AB?C

    Any string containing the pattern AC or ABC (0 or 1 B)

    ^[ABC]

    Any string starting with A, B, or C

    [^ABC]

    A string containing any characters other than A, B, or C

    ^[^abc]

    A string that begins with any character except a, b, or c

    ^[^a-z]$

    Any single-character string that is not a lowercase letter (^ and $ indicate the beginning and end of the string)

    [A-Z]+

    Any string with one or more uppercase letters

    ^[0-9]+$

    Any string consisting only of digits

    ^[0-9][0-9][0-9]$

    Any string consisting of exactly three digits

    ^([0-9][0-9][0-9])$

    Any consisting of exactly three digits enclosed in parentheses

     

    Examples

     

    This statement returns true if the text begins with one or more uppercase or lowercase letters (^ at the beginning of the pattern means that the beginning of the string must match the characters that follow):

    ^[A-Za-z]

    This statement returns false if the text contains any digits (^ inside a bracket is a complement operator):

    [^0-9]

    This statement returns true if the text contains one uppercase letter:

    [A-Z]

    This statement returns true if the text contains one or more uppercase letters (+ indicates one or more occurrences of the pattern):

    [A-Z]+

    This statement returns false if the text contains anything other than two digits followed by a letter (^ and $ indicate the beginning and end of the string):

    ^[0-9][0-9][A-Za-z]$