If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Hiding SSN Number

Started by rajua99, 31 Jan 2011 02:41:37 PM

Previous topic - Next topic

rajua99

Hi,

Is there a way to hide the SSN number in the report and just show them last 4 digits only.
SSN number should be in this format XXX-XX-1234

Thanks for all the help in proving solutions to resolve this issue for me.

Thanks,
Raju

cognostechie

You can use the substring function for this. The syntax will depend on what is the field type in the database table.

Ex: If the field is character with a format/mask of xxx-xx-xxxx then

'xxx-xx-' + substring(SSN,6.4)

There is another post in this forum for security on SSN Nos. Check that one too. 

rajua99


The field type is the numeric. I want to display both fields one with SSN number and another one with last 4 digits only.

I tired your solution but it is giving me error message when i test the sample.


Lynn

You can't perform a string function on a numeric value. Try casting it to a string first. There are few different ways to do this depending on your DBMS. I believe something similar to below should work.


'xxx-xx-' + substring(cast([SSN],VARCHAR(9)),6.4)

cognostechie

#4
rajua99 - There will be a comma between 6 and 4. I made a typo to make your life difficult !  ;)

rajua99

Quote from: Lynn on 02 Feb 2011 03:01:29 PM
You can't perform a string function on a numeric value. Try casting it to a string first. There are few different ways to do this depending on your DBMS. I believe something similar to below should work.


'xxx-xx-' + substring(cast([SSN],VARCHAR(9)),6.4)


This solution worked for me. Thanks a lot to Lynn and Cognostechie.