Skip to Content

Why do we need this post?

Value Mapping Groups(VMG) in PI are not designed to be used as Key Value Stores(KVS).

Trying to build a KVS using value mapping is confusing and counter intuitive. Every time I have to do this, I spend an hour trying to re-learn everything.

I hope this blog post saves me and everyone else some time.

What does a Key Value Store look like?

A combination of keys and values. You can use a key to lookup the corresponding value.

KVS.JPG

For example, a KVS with Employee ID’s and Names would look like:

EmployeeKeyValue.JPG

How do you use a PI Value Mapping to build this?


The corresponding VMG in PI can be built as follows:

EmployeeVMG.JPG

Understanding Rows:

Row #1(Const,Const,Const): The “Header Row” is a series of constants. You can save anything here. I recommend you store the column names in this row. For eg: EmpID and EmpName

Row #2..n(Const,Key,Value): The remaining rows will contain the key value pairs.

EmployeeVMG_Row1.JPG

Understanding Columns:

Column #1(Const): The first column should contain any constant value. I recommend you store KeyColumnName + ValueColumnName(EmpID_EmpName)

Column #2(Keys): The second column contains the keys.

Column #3(Values): The third column contains the values.

EmployeeVMG_Columns.JPG

Other Considerations:

There are several considerations when trying to use VMG as a KVS.

For eg:

The standard UDF cannot look up Key Values.

Values have length limitations.

Group ID vs Group Name

Mass Value Replication

I hope to cover some of these in my next post.

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Arpil Gupta

    Hi Harsh,

    Nice concept!!

    However the blog looks incomplete.

    It would be good if you cover how to utilize this in mapping.Also please mention benefits/limitation with this approach.

    * Can we use standard Value mapping function in graphical mapping ?

    * How can we set dynamic Agency,Schema ?

    One benefit I can see is we need not created multiple Groups.

    Regards

    Arpil

    (0) 
    1. Harsh Chawla Post author

      Hi April,

      Sorry for the delayed response.

      You are correct, this post leaves several things unexplained.

      I promise to post an update soon.

      Thanks,

      Harsh

      (0) 

Leave a Reply