Platform

Platform

A place for Apptio product users to learn, connect, share and grow together.

 View Only
  • 1.  TableMatch with Regex

    Posted Wed February 26, 2020 03:09 PM

    Can anyone point me to working examples using TableMatch and leveraging the Regex=TRUE option?

     

    I'm trying to do some pretty simple pattern matching and can't seem to find the trick ...

     

    I've tried both of the following RulesTables (named Entity Mappings):

     

    First version:

    OutputValueParsedRuleExpression
    Entity_B310....4110
    Entity_A310....4130
    Entity_B310....4135
    Entity_A310....4140
    Entity_A310....4160
    Entity_B310....4210
    Entity_A310....4220
    Entity_A310....4230
    Entity_A310....4240
    Entity_B310....43..
    Entity_C310........

     

    Second version

     

    OutputValueParsedRuleExpression
    Entity_B310\d\d\d\d4110
    Entity_A310\d\d\d\d4130
    Entity_B310\d\d\d\d4135
    Entity_A310\d\d\d\d4140
    Entity_A310\d\d\d\d4160
    Entity_B310\d\d\d\d4210
    Entity_A310\d\d\d\d4220
    Entity_A310\d\d\d\d4230
    Entity_A310\d\d\d\d4240
    Entity_B310\d\d\d\d43\d\d
    Entity_C

    310\d\d\d\d\d\d\d\

     

     

     

     

    My formulae for the resultant table includes the following:

     

    OutputValue=TableMatch(Entity Mappings,UseRegex=TRUE)

     

    Where my Source Table looks like this:

     

    ParsedRuleExpression
    31031404110
    31031404301
    31031204220
    31000008001

     

    I expected that I would get Entity B, Entity B, Entity A and Entity C, respectively.

     

    My understanding from the Regex documentation that Apptio pointed me to, that either "." or "\d" would work being Regex expressions for a single character and a single digit, respectively.

     

    This is the trivial set of input. Hopefully once I understand the "trivial" case, I can get to the more complicated. (And the values and rules table are dynamic, so it's going to be difficult to do this without the Regex option).



    #TBMStudio


  • 2.  Re: TableMatch with Regex

    Posted Thu February 27, 2020 09:24 AM

    I have experimented with TableMatch excluding the use of Regex and discovered that the Apptio processing engine is not very smart about the processing order of formulas in conjunction with TableMatch ... I had, within the same step, formulas that calculated the values for the source columns that were going to be used by TableMatch and the TableMatch itself.

     

    The order of processing that Apptio determined was appropriate was to do the TableMatch first, and then the calculations of the source columns. Needless to say, the TableMatch did not match anything correctly since it did not have correct values!

     

    The solution was to use two formula steps separated by a an unconfigured step (I used Date Partition). The first formula step is used to set up the values that will be required by TableMatch and the second step actually calls TableMatch.

     

    I have not tried this in combination with the usage of Regex, but suspect it might fix my problem. I am going to mark this assumed answered and move on with my solution that does not require Regex ...


    #TBMStudio