InfoSphere Optim

InfoSphere Optim

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  How to call multiple rows in LUA script to mask a column

    Posted Thu May 14, 2020 09:58 PM
    ​Hi All,
    Greetings!!
    Please have a look on below scenario and advise..
    I have a table which holds Customer's different Heath Care ID's.
    Each ID and it's description is present in a different Row of same table ( Cust_ID is join factor ).
    Few ID's were derived from combination of couple of other "Health ID's".

    The puzzle here is
    In the LUA script, using getcolumnvalue(Column1) we can only bring specific COLUMN of same row.
    To handle derived "Health ID's" I need to  call another row of same table to compare, Parse and Mask --> concatenate --> set as Target col.

    Example :-
    Table structure

    Row        PK         Cust_ID        Heath_ID                   ID_DESC                     RWUP_TS
    Row1   123456      555666         AB12345                    Health ID                    14 May 2020
    Row2   123457      555666         AB12345001              Health ID Spouse       14 May 2020
    Row3   123458      555666         AB123450001            Health ID Depen         14 May 2020
    Row4   123459      555666         AB123450002            Health ID Depen         14 May 2020
    Row4   123459      555666         AB12345D0002          Health ID Depen         14 May 2020

    So, consider I am masking Row3 for Health_ID column, here I need to compare it with Primary Health ID ( same column value from Row1) and parse the data into two strings Mask the actual ID how I have masked the Row1 for same column and concatenate suffix zero's and ones. Finally set the target value with concatenated number

    ------------------------------
    Harshavardhan Peddireddy
    ------------------------------

    #InfoSphereOptim
    #Optim


  • 2.  RE: How to call multiple rows in LUA script to mask a column

    Posted Fri May 15, 2020 05:17 PM
    Hi, Harshavardhan.

    The way I have handled this scenario is to parse the column value using LUA string functions, store the primary value and suffix in variables, use the Affinity provider to mask the primary value then concatenate the suffix to the newly masked primary value, and write it to the target.  You would be processing one row at a time, but it should get you the result you are looking for.

    Hope this helps!


    ------------------------------
    Trong Bo
    Senior Environment Administrator
    HealthNow New York
    ------------------------------



  • 3.  RE: How to call multiple rows in LUA script to mask a column

    Posted Sun May 17, 2020 12:35 PM
    Hi Trong,
    Thanks for prompt response.
    The problem here is, when I deal with Health ID of 3rd Row ​- how to call Primary/original Health ID from first row into LUA script.
    The compare -- Parse -- Mask -- Concatenate -- Set as Target will happen only when I am able to bring Primacy Health ID into LUA script.
    Please advise ..

    ------------------------------
    Harshavardhan Peddireddy
    ------------------------------



  • 4.  RE: How to call multiple rows in LUA script to mask a column

    Posted Tue May 19, 2020 04:11 PM
    Hi All,
    We have used Arrays/Table concept in the LUA programming and solved the problem.
    Thank you..

    ------------------------------
    Harshavardhan Peddireddy
    ------------------------------



  • 5.  RE: How to call multiple rows in LUA script to mask a column

    Posted Wed June 03, 2020 09:31 AM

    Hi Harsha,

    Could you pls provide more details on the solution?



    ------------------------------
    Rohit Jain
    ------------------------------



  • 6.  RE: How to call multiple rows in LUA script to mask a column

    Posted Mon June 08, 2020 07:09 PM
    Hi Rohit,

    We have stored all the possible source values ​for ID_DESC field using ARRAYS.
    And using IF and Else statements, we have passed specific categories into two different masking algorithms within same LUA.

    Refer below links..

    https://www.tutorialspoint.com/lua/lua_arrays.htm
    https://www.youtube.com/watch?v=ldjAN3YXRMc
    https://www.youtube.com/watch?v=lMWd7Jv0lAg

    ------------------------------
    Harshavardhan Peddireddy
    ------------------------------