Solved

Compare Two Data-Sets

Posted on 2011-03-14
5
335 Views
Last Modified: 2012-05-11
Hi Experts!

I am modifying an app that was handed on to me...

I need to compare insurance claims at two points in time.  I only need to report claims that have changed in value from Date 1 to Date 2 based on certain values; i.e. Total_Paid for example.  

I have two stored procedures that pull claim data as of 1/1/2010 and then another that pulls the claim data as of 1/1/2011.  I then want to compare Total_Paid_Amount_2010 to Total_Paid_Amount_2011. If its different, I write both records to a text file.

I'm  not familiar with datasets, datatables, etc.  Is this the best way to do  this?  Could anyone provide a generic example of obtaining the dataset, putting into data tables and then comparing the data.  I'm under a very tight time constraint....
0
Comment
Question by:tobin46
5 Comments
 
LVL 9

Assisted Solution

by:sshah254
sshah254 earned 150 total points
ID: 35134656
I would do this in SQL if I were you.  It will be much faster there.

Essentially there will be a table, or bunch of tables that hold the data for the claim.

But if you are unfamiliar with SQL, or do not have the schema of your database, then you should stick to what is familiar to you.

Ss
0
 
LVL 1

Author Comment

by:tobin46
ID: 35134734
I'm much better in SQL than VB.Net.  Can you provide an example as to how I could accomplish it there....

The stored procedure is rather long and complicated because of the database schema.  

Can you provide a generic example, logic, psuedocode...?
0
 
LVL 1

Author Comment

by:tobin46
ID: 35134749
I'd prefer a Vb.Net solution.....I think.  Only because this has a few moving parts to it outside of the claim comparison.  
0
 
LVL 16

Assisted Solution

by:Kalpesh Chhatrala
Kalpesh Chhatrala earned 150 total points
ID: 35135438
0
 
LVL 7

Accepted Solution

by:
foobarr earned 200 total points
ID: 35150838
if you have two datasets

dset1
dset2

for each dRow1 as datarow in dset1.tables(0).rows
     for each drow2 as datarow in dset2.tables(0).rows
            if drow1("column name") = drow2("column name")
                     'condition is true
                     exit for
           else
                     'condition is false
           end if
     next
next


basically you take the first dataset, for each row in that dataset you compare it against all of the rows in the second dataset.  For your condition statement, whatever you are checking, if you have found what you are looking for then you can exit the second for loop and then it will check the next row all over again.


but I would suggest doing this comparison in sql in your database.  
what does your stored procedure look like right now?




0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now