# New to QlikView

Discussion board where members can get started with QlikView.

Contributor II

## how to create a transformation subroutine only for one column of table for security purpose ?

Hi All ,

I have requirement in two parts :

a) How to create a  transformation subroutine only for one column of table for security purpose for first 5 numbers/letters ?
b) Transformation logic changes day wise .

 first_name last_name CREDIT CARD Nbr Date_of_Use Kerrill Stenning switch 4903490391711560 22-01-2017

So credit card number should be twiked to something like this

First number from 4903490391711560 is

Logic based on Day 7th since 22/02/2017

4 + 7 (because 22 jan 2017 was 7th day of that week) = 11

9 + 1 (1st month of year) = 10
0 + (11+10) = 21
3  * 16 (Total length of Nbr) = 48

4 * 5 ( even 5 number is even then multiply by next upper odd number , if odd then add 6) = 20

Hence

4903490391711560 changes to ---------> 111021482090391711560

Logic based on Day 6th

4 + (6*2)  (because 21 jan 2017 was 6th day of that week) = 16

9 + 1 (1st month of year) = 10
0 + (11+10) = 21
3  * 16 (Total length of Nbr) = 48

4 * 5 ( even 5 number is even then multiply by next upper odd number , if odd then add 6) = 20

4903490391711560 changes to ---------> 161021482090391711560

Similarly there are different logic for all seven days of the week @

Thanks & Regards

Shekar

20 Replies
Contributor II

## Re: how to create a transformation subroutine only for one column of table for security purpose ?

A few introductory questions:

• What is the role of date 22/2/2017 in this story? See bold black line.
• Which date is driving the algorithm selection? Today() ? The day of the current reload? Some other date?
• You describe 2 algorithms that only differ in the way they translate the first digit. Where are the 5 others?

Peter

Contributor II

## Re: how to create a transformation subroutine only for one column of table for security purpose ?

Hi Peter ,

Date 22/2/2017 refers to date of swipe of credit card for user . And actually it drives every thing of algorithm .

If the date of use falls on first day of week i.e Monday then there is a set of logic , if its on 2nd day of week i.e Tuesday then there is different logic . It is just that i have highlighted logic for 7th day because 22 jan 2017 was sunday .

Other 5 algorithm i will be taking care , after going through solution for above two days

Honored Contributor

## Re: how to create a transformation subroutine only for one column of table for security purpose ?

Logic based on Day 6th

4 + (6*2)  (because 21 jan 2017 was 6th day of that week) = 16      //Why multiplying  by 2??

9 + 1 (1st month of year) = 10
0 + (11+10) = 21                                                                         //If above is correct why not 16 +10???
3  * 16 (Total length of Nbr) = 48

4 * 5 ( even 5 number is even then multiply by next upper odd number , if odd then add 6) = 20

Im not getting your logic behind this!

Contributor II

## Re: how to create a transformation subroutine only for one column of table for security purpose ?

4 + (6*2)  (because 21 jan 2017 was 6th day of that week) = 16      //Why multiplying  by 2??

4 + (6th day * 2) its a fixed number , 2 is fixed number

9 + 1 (1st month of year) = 10

0 + (11+10) = 21  .. year your are correct it should be 16+10 , agreed my mistake

Honored Contributor

## Re: how to create a transformation subroutine only for one column of table for security purpose ?

so if its the fifth day it should be multiplyed by 3 and so on?

because in Logic based on Day 7th you did not multiply by 2

Contributor II

## Re: how to create a transformation subroutine only for one column of table for security purpose ?

Actually multiplication by 2 is only for day 6 , not for day 7

Contributor II

## Re: how to create a transformation subroutine only for one column of table for security purpose ?

for 5 day the logic is different .. completely different

Honored Contributor

## Re: how to create a  transformation subroutine only for one column of table for security purpose ?

then i guess we need to know the complete logic