Forum Discussion

Pawel's avatar
Pawel
New Contributor II
15 hours ago

Composite rule for filled value only

Hi,

is there a way how to apply composite rule on filled value only? If I use U8#* it takes every record filled or not.

My intention is to use another rule behind this one to fill default value for blank source.

 

1 Reply

  • RobbSalzmann's avatar
    RobbSalzmann
    Valued Contributor II

    This is not a good use case for using a composite rule. Composite rules are best used when a member in one or more other dimensions drives the mapping of the current dimension.

    Here's how I would approach this:

    1. Add code in your connector rule to detect null or empty string in the fields where blanks may come in, and replace them with something like <BLANK>
      1. You could use a form of logical expression.  I prefer using connector rules because they have more structure and are easier to see, code, and troubleshoot.
    2. Create a Mask rule
      1. Expression: *
      2. Target Value: *
    3. Create a One-To-One rule to map <BLANK> to whatever target member (e.g. None) you want

    The transformation rules will run the One-To-One first, and whatever is left will be mapped by the Mask, anything not <BLANK> in this case.