Home
%3CLINGO-SUB%20id%3D%22lingo-sub-388152%22%20slang%3D%22en-US%22%3ECleansing%20Customer%20Data%20Using%20Data%20Quality%20Services%20(DQS)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-388152%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20MSDN%20on%20Jun%2014%2C%202013%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3ESQL%20Server%202012%20Data%20Quality%20Services%20(DQS)%20enables%20you%20to%20cleanse%20data%20using%20your%20own%20Knowledge%20Base.%20In%20this%20blog%20article%2C%20I%20am%20going%20to%20show%20how%20to%20create%20a%20simple%20Knowledge%20Base%20which%20you%20can%20use%20to%20cleanse%20your%20customer%20data.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20steps%20for%20using%20DQS%20to%20cleanse%20data%20is%20as%20follows%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSTRONG%3EA.%20Create%20DQS%20Knowledge%20Base%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20%3CSTRONG%3E%20B.%20Create%20a%20DQS%20project%20to%20cleanse%20your%20data%20using%20the%20Knowledge%20Base%3C%2FSTRONG%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EFor%20this%20example%2C%20I%20am%20using%20the%20following%20sample%20data%20-%20you%20can%20run%20the%20following%20script%20on%20your%20SQL%20Server%20database%26nbsp%3B%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ECREATE%20TABLE%20MyCustomers%20%3CBR%20%2F%3E%20(%20%3CBR%20%2F%3E%20CustomerID%20INT%2C%20%3CBR%20%2F%3E%20CustomerName%20NVARCHAR(255)%2C%20%3CBR%20%2F%3E%20City%20NVARCHAR(32)%2C%20%3CBR%20%2F%3E%20Province%20NVARCHAR(32)%2C%20%3CBR%20%2F%3E%20LastUpdate%20DATETIME%20%3CBR%20%2F%3E%20)%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20INSERT%20INTO%20MyCustomers%20%3CBR%20%2F%3E%20VALUES%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20(1%2C%20'Consolidate%20Co%20Ltd'%2C%20'Miami'%2C%20'FL'%2C'2013-01-01')%2C%20%3CBR%20%2F%3E%20(2%2C%20'Consolidation%20Company%20Ltd'%2C%20'New%20York'%2C%20'NY'%2C'2013-01-01')%2C%20%3CBR%20%2F%3E%20(3%2C%20N'%E4%BB%80%E9%94%A6%E7%9A%84%E4%BB%B6'%2C%20'LA'%2C%20'CA'%2C'2013-01-01')%2C%20%3CBR%20%2F%3E%20(4%2C%20'Chop-suey%20Chinese'%2C%20'Los%20Angeles'%2C%20'CA'%2C%20'2013-03-03')%2C%20%3CBR%20%2F%3E%20(5%2C%20'Big%20Cheese%2C%20The'%2C%20'Redmond'%2C%20'WA'%2C%20'2013-02-02')%2C%20%3CBR%20%2F%3E%20(6%2C%20'THE%20BIG%20CHEESE'%2C%20'Chicago'%2C%20'Il'%2C'2013-02-02')%2C%20%3CBR%20%2F%3E%20(7%2C%20'To%20Be%20Filled%20Later'%2C%20'Redmond'%2C%20'Wash.'%2C%20'2013-01-01')%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%3CH3%20id%3D%22toc-hId-1484324410%22%20id%3D%22toc-hId-1565417531%22%3EA.%20Create%20DQS%20Knowledge%20Base%3C%2FH3%3E%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3CLI%3EStart%20Data%20Quality%20Client.%20For%20information%20about%20this%20step%2C%20refer%20to%20Run%20the%20Data%20Quality%20Client%20Application.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EIn%20the%20Data%20Quality%20Client%20home%20screen%2C%20under%20Knowledge%20Base%20Management%2C%20click%20New%20Knowledge%20Base.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EName%20your%20new%20Knowledge%20Base%20(e.g.%20MyCustomerKB)%2C%20make%20sure%20Domain%20Management%20activity%20is%20selected%20and%20click%20Next%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FOL%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99810iE059A2CA5F5DB3E1%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3CLI%3EClick%20Create%20Domain%20Icon.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FOL%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99811i2715E39360908CCE%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3CLI%3EFrom%20the%20pop-up%20window%2C%20name%20your%20domain%20(e.g.%20CustomerName).%20As%20an%20option%2C%20you%20can%20select%20to%20change%20the%20format%20of%20the%20output%20to%20Capitalize.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FOL%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99812i19F5A22B23E61424%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3CLI%3ERepeat%20the%20steps%20and%20create%20domains%20for%20City%20and%20State.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3ESelect%20City%20domain%20and%20click%20on%20domain%20values%20tab.%20In%20this%20screen%2C%20you%20can%20enter%20all%20the%20list%20of%20valid%20and%20invalid%20values%20for%20the%20domain.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FOL%3E%0A%20%20%3CUL%3E%3CBR%20%2F%3E%3CLI%3EClick%20on%20Add%20new%20domain%20value%20icon.%20Enter%20a%20correct%20value%20(e.g.%20Los%20Angeles)%20then%20press%20enter.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EClick%20on%20Add%20new%20domain%20value%20icon.%20Enter%20an%20invalid%20value%20for%20the%20city%20(e.g.%20United%20States)%2C%20click%20the%20down%20arrow%20in%20the%20Type%20column%20and%20select%20the%20invalid%20type%20(yellow%20triangle)%20then%20press%20enter.%20(There%20are%203%20supported%20type%3A%20correct%2C%20invalid%2C%20and%20error%3B%20invalid%20suggests%20that%20the%20value%20is%20not%20valid%20for%20the%20given%20domain%2C%20but%20may%20be%20valid%20in%20a%20different%20domain.%20For%20example%2C%20United%20States%20is%20not%20a%20valid%20value%20for%20city%20domain%20but%20is%20a%20valid%20value%20for%20country%20domain%3B%20error%20suggests%20that%20the%20value%20is%20globally%20incorrect).%20For%20invalid%20or%20error%20value%2C%20you%20can%20optionally%20specify%20correct%20to%20value%20for%20DQS%20to%20automatically%20correct.%20Otherwise%2C%20records%20with%20invalid%20or%20error%20value%20will%20be%20flag%20as%20invalid%20during%20cleansing.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EClick%20on%20Add%20new%20domain%20value%20icon.%20Enter%20a%20synonym%20value%20for%20the%20city%20(e.g.%20LA)%20then%20press%20enter.%20Highlight%20both%20%22LA%22%20and%20%22Los%20Angeles%22%20values%2C%20right%20click%20then%20select%20Set%20as%20Synonyms.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99813iADD03DC12A76BF1E%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ENote%3A%20by%20default%2C%20DQS%20include%20DQS_NULL%20as%20valid%20value%20for%20the%20domain%2C%20you%20can%20change%20the%20type%20to%20invalid%20if%20you%20would%20like%20the%20record%20with%20missing%20value%20to%20be%20flagged%3C%2FP%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3EUpdate%20the%20leading%20value%20by%20right%20clicking%20Los%20Angeles%20and%20select%20Set%20as%20Leading%26nbsp%3Bduring%20cleansing.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99814i911602F2B4EB0829%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3EThe%20final%20city%20domain%20values%20should%20look%20as%20follows%3A%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99815iE704435C1B0A1C28%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3CLI%3ESelect%20State%20domain%20and%20click%20on%20domain%20values%20tab.%20In%20this%20step%2C%20we%20will%20import%20the%20values%20from%20a%20spreadsheet.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FOL%3E%0A%20%20%3CUL%3E%3CBR%20%2F%3E%3CLI%3EObtain%20the%20list%20of%20US%20states%2C%20its%20standard%20abbreviation%20and%20postal%20abbreviation%20from%20%3CA%20href%3D%22http%3A%2F%2Fwww.stateabbreviations.us%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20here%20%3C%2FA%3E%20.%20Copy%20the%20first%203%20columns%20into%20excel%20and%20save%20as%20csv%20file.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EClick%20the%20down%20arrow%20next%20to%20import%20values%20icon%20on%20the%20state%20domain%20management%20and%20select%20import%20valid%20values%20from%20excel.%20From%20the%20pop-up%20window%2C%20browse%20to%20the%20location%20of%20the%20csv%20file%20(make%20sure%20to%20select%20file%20type%20as%20csv)%20and%20update%20Use%20First%20row%20as%20header%20checkbox%20according%20to%20your%20file%20(if%20you%20do%20not%20include%20header%20when%20you%20prepare%20the%20file%2C%20then%20you%20can%20leave%20the%20default%20option%20unchecked.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99816i8753F96E20526ED1%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3EYou%20should%20see%20the%20State%20domain%20values%20screen%20populated%20as%20below%20-%20notice%20that%20when%20you%20import%20list%20of%20values%20with%20more%20than%20one%20column%2C%20DQS%20automatically%20set%20the%20first%20column%20as%20leading%20value%20and%20the%20subsequent%20column%20value%20as%20its%20synonyms.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99817iB08960B0E8C66629%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3CLI%3ESelect%20CustomerName%20domain%20and%20click%20on%20Term-Based%20Relations%20tab.%20DQS%20allows%20you%20to%20define%20terms%20within%20your%20domain%20value%20and%20standardize%20them%20into%20standard%20term.%20For%20example%2C%20business%20name%20often%20include%20abbreviation%20such%20as%20%22corp%22%2C%20etc.%20When%20there%20are%20variation%20for%20the%20use%20of%20the%20terms%20(e.g.%20one%20record%20may%20use%20abbreviation%20such%20as%20%22Microsoft%20Corp%22%20while%20another%20record%20may%20have%20values%20for%20%22Microsoft%20Corporation%22)%2C%20you%20can%20use%20DQS%20to%20standardize%20the%20use%20of%20terms%20within%20your%20domain%20values.%20In%20this%20step%2C%20we%20will%20define%202%20term%20based%20relations%20for%20our%20CustomerName%20domain%3A%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FOL%3E%0A%20%20%3CUL%3E%3CBR%20%2F%3E%3CLI%3EClick%20Add%20new%20relation%20icon%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EAdd%20%22co%22%20as%20value%20and%20%22Company%22%20as%20correct%20to.%20Press%20enter%20to%20continue.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EAdd%20%22ltd%22%20as%20value%20and%20%22Limited%22%20as%20correct%20to.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EYou%20should%20see%20the%20CompanyName%20Term-Based%20Relations%20screen%20to%20be%20populated%20as%20below.%20Click%20finish%20to%20continue.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99818i16D82788363255DE%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3CLI%3EClick%20Publish%20Knowledge%20Base%20button%20to%20continue.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FOL%3E%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ECreating%20your%20own%20DQS%20Knowledge%20Base%20sometimes%20requires%20a%20lot%20of%20effort.%20For%20things%20such%20as%20address%20cleansing%2C%20phone%20number%20cleansing%2C%20creating%20your%20own%20complete%20list%20of%20all%20valid%20and%20invalid%20values%20can%20be%20a%20huge%20effort.%20DQS%20supports%20integration%20with%20third%20party%20service%20provider%20to%20cleanse%20your%20data%20through%20DQS.%20Refer%20to%20my%20blog%20article%20on%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Fdqs%2Farchive%2F2013%2F06%2F11%2Fcleansing-your-customer-data-using-dun-amp-bradstreet-dqs-service.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20how%20to%20cleanse%20Customer%20Data%20using%20Dun%20%26amp%3B%20Bradstreet%20%3C%2FA%3E%20for%20more%20information.%3C%2FP%3E%3CBR%20%2F%3E%3CH3%20id%3D%22toc-hId--1067832551%22%20id%3D%22toc-hId--986739430%22%3EB.%20Create%20a%20DQS%20project%20to%20cleanse%20your%20data%20using%20the%20Knowledge%20Base%3C%2FH3%3E%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3CLI%3EIn%20the%20Data%20Quality%20Client%20home%20screen%2C%20under%20Data%20Quality%20Projects%2C%20click%20New%20Data%20Quality%20Project.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EName%20your%20new%20Project%20(e.g.%20MyCustomer%20Cleansing%20Project)%2C%20make%20sure%20you%20select%20Knowledge%20Base%20created%20in%20the%20previous%20step%20(e.g.%20MyCustomerKB)%20then%20click%20Next%20to%20continue.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EIn%20the%20Map%20screen%3A%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FOL%3E%0A%20%20%3CUL%3E%3CBR%20%2F%3E%3CLI%3ESelect%20data%20source%2C%20database%2C%20and%20table%20for%20your%20data%20(e.g.%20MyCustomers%20table%20and%20data%20generated%20from%20the%20script%20at%20the%20beginning%20of%20this%20article)%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3ESelect%20columns%20to%20be%20cleansed%20and%20map%20to%20the%20domains%20in%20your%20knowledge%20base%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EYou%20should%20have%20your%20datasource%20columns%20mapped%20as%20below.%20Click%20Next%20to%20continue.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99819i72E7AE90C751FBAE%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3CLI%3EIn%20the%20Cleanse%20screen%2C%20click%20Start%20to%20begin%20the%20process.%20Click%20Next%20when%20the%20process%20finishes.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EIn%20the%20Manage%20and%20View%20results%20screen%3A%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FOL%3E%0A%20%20%3CUL%3E%3CBR%20%2F%3E%3CLI%3ESelect%20City%20domain%20and%20click%20Corrected%20tab.%20You%20should%20see%20%22LA%22%20corrected%20to%20%22Los%20Angeles%22%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99820i013509D16F43596F%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3C%2FOL%3E%0A%20%20%3CUL%3E%3CBR%20%2F%3E%3CLI%3ESelect%20City%20domain%20and%20click%20New%20tab.%20You%20should%20see%20the%20list%20of%20city%20not%20defined%20in%20the%20knowledge%20base%20domain%20value%20definition%20listed%20here.%20Click%20Approve%20all%20terms%20icon%20to%20continue%20(Refer%20to%20%3CA%20href%3D%22http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fhh479581.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20this%20msdn%20article%20%3C%2FA%3E%20on%20how%20do%20import%20all%20approved%20project%20values%20into%20DQS%20knowledge%20base).%20The%20approved%20values%20are%20now%20appear%20under%20Correct%20tab.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99821i324CB83C5FDF0FB2%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3C%2FOL%3E%0A%20%20%3CUL%3E%3CBR%20%2F%3E%3CLI%3ESelect%20CustomerName%20domain%20and%20click%20New%20tab.%20You%20should%20see%20Customer%20Names%20are%20updated%20to%20use%20standardized%20terms.%20Click%20Next%20to%20continue.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99822iC51A82219FF9EAB0%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3CLI%3EIn%20the%20Manage%20and%20View%20results%20screen%2C%20you%20can%20export%20the%20results%20to%20SQL%20Server%20table%20or%20Excel.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FOL%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99823i9D040DD1EA5274F3%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIn%20this%20blog%20article%2C%20I%20discussed%20how%20to%20create%20a%20Knowledge%20Base%20to%20cleanse%20customer%20data%2C%20including%20use%20of%20domain%20values%20and%20term%20based%20relations.%20You%20can%20then%20refer%20to%20the%20Knowledge%20Base%20to%20create%20Data%20Quality%20Projects%20to%20cleanse%20your%20data.%20You%20can%20use%20the%20same%20knowledge%20base%20to%20perform%20cleansing%20on%20many%20Data%20Quality%20Projects.%20You%20can%20also%20automate%20the%20cleansing%20using%20SQL%20Server%202012%20Integration%20Services.%20Matt%20Mason%20wrote%20a%20nice%20article%20%3A%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Fmattm%2Farchive%2F2011%2F07%2F14%2Foverview-of-the-dqs-cleansing-transform.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Overview%20of%20DQS%20Transform%20%3C%2FA%3E%20that%20describes%20the%20SSIS%20DQS%20Cleansing%20transform.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EYou%20may%20also%20notice%20that%20there%20appears%20to%20be%20duplicate%20records%20in%20the%20sample%20data%20I%20used.%20In%20the%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Fdqs%2Farchive%2F2013%2F06%2F17%2Fmatching-related-and-duplicate-customer-records-using-sql-server-data-quality-services-dqs.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20next%20article%20%3C%2FA%3E%20%2C%20I%20will%20describe%20on%20how%20to%20enhance%20your%20knowledge%20base%20by%20adding%20matching%20policy%20and%20identify%20duplicate%20and%20related%20records%20in%20your%20dataset.%3C%2FP%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-388152%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Jun%2014%2C%202013%20SQL%20Server%202012%20Data%20Quality%20Services%20(DQS)%20enables%20you%20to%20cleanse%20data%20using%20your%20own%20Knowledge%20Base.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-388152%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E2012%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ecleansing%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edata%20cleansing%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edata%20quality%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edata%20quality%20service%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edata%20quality%20services%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edqs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edqs%20cleansing%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edqs%20cleansing%20component%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eknowledge%20base%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESQL%20Server%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Esqlserver%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Regular Visitor
First published on MSDN on Jun 14, 2013

SQL Server 2012 Data Quality Services (DQS) enables you to cleanse data using your own Knowledge Base. In this blog article, I am going to show how to create a simple Knowledge Base which you can use to cleanse your customer data.


The steps for using DQS to cleanse data is as follows:


A. Create DQS Knowledge Base
B. Create a DQS project to cleanse your data using the Knowledge Base


For this example, I am using the following sample data - you can run the following script on your SQL Server database :


CREATE TABLE MyCustomers
(
CustomerID INT,
CustomerName NVARCHAR(255),
City NVARCHAR(32),
Province NVARCHAR(32),
LastUpdate DATETIME
)

INSERT INTO MyCustomers
VALUES      (1, 'Consolidate Co Ltd', 'Miami', 'FL','2013-01-01'),
(2, 'Consolidation Company Ltd', 'New York', 'NY','2013-01-01'),
(3, N'什锦的件', 'LA', 'CA','2013-01-01'),
(4, 'Chop-suey Chinese', 'Los Angeles', 'CA', '2013-03-03'),
(5, 'Big Cheese, The', 'Redmond', 'WA', '2013-02-02'),
(6, 'THE BIG CHEESE', 'Chicago', 'Il','2013-02-02'),
(7, 'To Be Filled Later', 'Redmond', 'Wash.', '2013-01-01')



A. Create DQS Knowledge Base



  1. Start Data Quality Client. For information about this step, refer to Run the Data Quality Client Application.

  2. In the Data Quality Client home screen, under Knowledge Base Management, click New Knowledge Base.

  3. Name your new Knowledge Base (e.g. MyCustomerKB), make sure Domain Management activity is selected and click Next




  1. Click Create Domain Icon.




  1. From the pop-up window, name your domain (e.g. CustomerName). As an option, you can select to change the format of the output to Capitalize.




  1. Repeat the steps and create domains for City and State.

  2. Select City domain and click on domain values tab. In this screen, you can enter all the list of valid and invalid values for the domain.


  • Click on Add new domain value icon. Enter a correct value (e.g. Los Angeles) then press enter.

  • Click on Add new domain value icon. Enter an invalid value for the city (e.g. United States), click the down arrow in the Type column and select the invalid type (yellow triangle) then press enter. (There are 3 supported type: correct, invalid, and error; invalid suggests that the value is not valid for the given domain, but may be valid in a different domain. For example, United States is not a valid value for city domain but is a valid value for country domain; error suggests that the value is globally incorrect). For invalid or error value, you can optionally specify correct to value for DQS to automatically correct. Otherwise, records with invalid or error value will be flag as invalid during cleansing.

  • Click on Add new domain value icon. Enter a synonym value for the city (e.g. LA) then press enter. Highlight both "LA" and "Los Angeles" values, right click then select Set as Synonyms.




Note: by default, DQS include DQS_NULL as valid value for the domain, you can change the type to invalid if you would like the record with missing value to be flagged




    • Update the leading value by right clicking Los Angeles and select Set as Leading during cleansing.






    • The final city domain values should look as follows:





  1. Select State domain and click on domain values tab. In this step, we will import the values from a spreadsheet.


  • Obtain the list of US states, its standard abbreviation and postal abbreviation from here . Copy the first 3 columns into excel and save as csv file.

  • Click the down arrow next to import values icon on the state domain management and select import valid values from excel. From the pop-up window, browse to the location of the csv file (make sure to select file type as csv) and update Use First row as header checkbox according to your file (if you do not include header when you prepare the file, then you can leave the default option unchecked.






    • You should see the State domain values screen populated as below - notice that when you import list of values with more than one column, DQS automatically set the first column as leading value and the subsequent column value as its synonyms.





  1. Select CustomerName domain and click on Term-Based Relations tab. DQS allows you to define terms within your domain value and standardize them into standard term. For example, business name often include abbreviation such as "corp", etc. When there are variation for the use of the terms (e.g. one record may use abbreviation such as "Microsoft Corp" while another record may have values for "Microsoft Corporation"), you can use DQS to standardize the use of terms within your domain values. In this step, we will define 2 term based relations for our CustomerName domain:


  • Click Add new relation icon

  • Add "co" as value and "Company" as correct to. Press enter to continue.

  • Add "ltd" as value and "Limited" as correct to.

  • You should see the CompanyName Term-Based Relations screen to be populated as below. Click finish to continue.





  1. Click Publish Knowledge Base button to continue.



Creating your own DQS Knowledge Base sometimes requires a lot of effort. For things such as address cleansing, phone number cleansing, creating your own complete list of all valid and invalid values can be a huge effort. DQS supports integration with third party service provider to cleanse your data through DQS. Refer to my blog article on how to cleanse Customer Data using Dun & Bradstreet for more information.


B. Create a DQS project to cleanse your data using the Knowledge Base



  1. In the Data Quality Client home screen, under Data Quality Projects, click New Data Quality Project.

  2. Name your new Project (e.g. MyCustomer Cleansing Project), make sure you select Knowledge Base created in the previous step (e.g. MyCustomerKB) then click Next to continue.

  3. In the Map screen:


  • Select data source, database, and table for your data (e.g. MyCustomers table and data generated from the script at the beginning of this article)

  • Select columns to be cleansed and map to the domains in your knowledge base

  • You should have your datasource columns mapped as below. Click Next to continue.





  1. In the Cleanse screen, click Start to begin the process. Click Next when the process finishes.

  2. In the Manage and View results screen:


  • Select City domain and click Corrected tab. You should see "LA" corrected to "Los Angeles"






  • Select City domain and click New tab. You should see the list of city not defined in the knowledge base domain value definition listed here. Click Approve all terms icon to continue (Refer to this msdn article on how do import all approved project values into DQS knowledge base). The approved values are now appear under Correct tab.






  • Select CustomerName domain and click New tab. You should see Customer Names are updated to use standardized terms. Click Next to continue.





  1. In the Manage and View results screen, you can export the results to SQL Server table or Excel.



In this blog article, I discussed how to create a Knowledge Base to cleanse customer data, including use of domain values and term based relations. You can then refer to the Knowledge Base to create Data Quality Projects to cleanse your data. You can use the same knowledge base to perform cleansing on many Data Quality Projects. You can also automate the cleansing using SQL Server 2012 Integration Services. Matt Mason wrote a nice article : Overview of DQS Transform that describes the SSIS DQS Cleansing transform.


You may also notice that there appears to be duplicate records in the sample data I used. In the next article , I will describe on how to enhance your knowledge base by adding matching policy and identify duplicate and related records in your dataset.