Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to mask a datafield ?
ericchung
<p>for instance, <span style="font-size:14px;">a s</span><span style="font-size:14px;">tring "MyString" with mask covered as "M***ring", </span></p>
<p> </p>
<p>when setting a Format code @ in Custom Format String,</p>
<p>the result comes out as "MySt***ring",</p>
<p>instead of covering, 3 asterisks was inserted into the string and the string length was <span style="font-size:14.3999996185303px;">extended</span><span style="font-size:14px;">.</span></p>
<p><span style="font-size:14px;">how to set a correct mask (format) to let</span><span style="font-size:14.3999996185303px;"> "MyString" become</span><span style="font-size:14.3999996185303px;"> "M***ring"?</span></p>
<p><span style="font-size:14.3999996185303px;">thanks.</span></p>
Find more posts tagged with
Comments
kclark
<p>In the data set binding you could use some script like this</p>
<pre class="_prettyXprint _lang-">
var field = new String();
var replacement = new String();
field = dataSetRow["CUSTOMERNAME"]
replacement = field.substring(0,3);
field = field.replace(replacement, "****");
field;
</pre>
ericchung
<div><span style="color:rgb(0,0,0);font-family:helvetica, arial, sans-serif;font-size:14.3999996185303px;">Thanks, Kristopher.</span></div>
<p><span style="color:rgb(0,0,0);font-family:helvetica, arial, sans-serif;font-size:14.3999996185303px;">My solution is to mask it from selection, something like</span></p>
<p><span style="color:rgb(0,0,0);font-family:helvetica, arial, sans-serif;font-size:14.3999996185303px;">"select substr(</span><span style="color:rgb(0,136,0);font-size:14px;">CUSTOMERNAME,0,3</span><span style="color:rgb(0,0,0);font-family:helvetica, arial, sans-serif;font-size:14.3999996185303px;">) + '***' + </span><span style="font-size:14.3999996185303px;color:rgb(0,0,0);font-family:helvetica, arial, sans-serif;">substr(</span><span style="font-size:14px;color:rgb(0,136,0);">CUSTOMERNAME,6</span><span style="font-size:14.3999996185303px;color:rgb(0,0,0);font-family:helvetica, arial, sans-serif;">) from tableA</span><span style="color:rgb(0,0,0);font-family:helvetica, arial, sans-serif;font-size:14.3999996185303px;">".</span></p>