SOLVED

Data Quality history

%3CLINGO-SUB%20id%3D%22lingo-sub-281209%22%20slang%3D%22en-US%22%3EData%20Quality%20history%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-281209%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20guys%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20need%20some%20help%20with%20an%20easy%20data%20import.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20table%20with%20some%20history%20data%20in%20it%2C%20imported%20during%20certain%20dates%20(Snapshot_Date).%3C%2FP%3E%3CP%3ESome%20fields%20in%20the%20table%20are%20blank%20at%20certain%20import%20dates%20and%20then%20populated%20with%20data.%20I%20would%20like%20to%20check%20this%20data%20quality%20in%20some%20way.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example%2C%201.png%26nbsp%3Bis%20a%20sample%20table%20with%20bogus%20data.%3C%2FP%3E%3CP%3EUpon%20inserting%20new%20data%20into%20the%20table%20tomorrow%2C%20for%20example%2C%20I'd%20like%26nbsp%3Ban%20IF%20statement%20(or%20some%20other%20way)%20that%20will%20check%20if%20Address%20field%20is%20null%2C%20see%202%3CSPAN%3E.png%3C%2FSPAN%3E.%3C%2FP%3E%3CP%3EIf%20Address%20is%20null%2C%20then%20add%20FAILED%20in%20the%20Check_Address%20field.%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20Address%20is%20not%20null%2C%20then%20add%26nbsp%3BPASSED%26nbsp%3Bin%20the%20Check_Address%20field.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20insert%20data%20into%20the%20history%20table%2C%20I'm%20using%20a%20View%26nbsp%3Bthat%20gets%20data%20from%20a%20table%20with%20current%20data%2C%20I'm%20adding%26nbsp%3BGETDATE()%20that%20will%20become%20Snapshot_Date%20and%20that's%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20using%20IF%2FElse%20and%20Case%20in%20my%20View%2C%20but%20looks%20like%20I'm%20missing%20something...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-281209%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAnalytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EData%20Warehouse%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-281217%22%20slang%3D%22en-US%22%3ERe%3A%20Data%20Quality%20history%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-281217%22%20slang%3D%22en-US%22%3E%3CP%3ESorted%20it%20out%2C%20my%20NULL%20check%20was%20the%20issue.%3C%2FP%3E%3CP%3E3.png%20is%20just%20an%20example%20how%20it%20looks%20like%20with%20all%20bogus%20data%2C%20but%20this%20will%20get%20me%20started%20with%20what%20I%20actually%20need.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

Hi guys,

 

I would need some help with an easy data import.

 

I have a table with some history data in it, imported during certain dates (Snapshot_Date).

Some fields in the table are blank at certain import dates and then populated with data. I would like to check this data quality in some way.

 

For example, 1.png is a sample table with bogus data.

Upon inserting new data into the table tomorrow, for example, I'd like an IF statement (or some other way) that will check if Address field is null, see 2.png.

If Address is null, then add FAILED in the Check_Address field.

If Address is not null, then add PASSED in the Check_Address field.

 

To insert data into the history table, I'm using a View that gets data from a table with current data, I'm adding GETDATE() that will become Snapshot_Date and that's it.

 

I tried using IF/Else and Case in my View, but looks like I'm missing something...

1 Reply
Highlighted
Solution

Sorted it out, my NULL check was the issue.

3.png is just an example how it looks like with all bogus data, but this will get me started with what I actually need.