cancel
Showing results for 
Search instead for 
Did you mean: 

Comparing data without loosing product position

LorenzoCapoccia
Level 4
Hi,
I have added some description to a triggered error that I done in case where 2 collections row count are different in order to proceed with a comparison.. I am just trying to figure out what's the best way, as I noticed, that the comparison will happen correctly, but the last row ( containing data ) is removed, and so that is not acceptable...
Adding row numbers will that solve the problem or will cause even more errors?


thank you
3 REPLIES 3

PvD_SE
Level 12

Hi Lorenzo,

Rather than putting the problem description in a word doc, try and describe it in your thread and insert screenshots if needed. In these days of ransomware, not everyone (I for one) is prepared to risk opening documents from the interweb.

Happy coding!
Paul
Sweden 

Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

LorenzoCapoccia
Level 4

 Hi @PvD_SE,

Thank you for taking your time on this matter.. one more thing I would like to add  for the below comment, as per test, I noticed that if i don't add any note in the empty row, then on the final stage to compare I actually do loose the one row from the main data,... and I rather have an error than loose the data info

I would like to add this option to check if between the main data SDPI and Cognos, there is a mismatch count,  this should not happen in reality.

 

But if that happens, I have added the option to add (with calculation stage a comment to fill an empty row = Wcode Review Manually


36712.png


Unfortunately, this doesn’t fix the primary issue, as you see the Material ID Cognos, loses the row and the match NO it is exposed for all rest of material number.

The Wcode word, is added just to ensure no error for missing row appears, but if a solution is found to resolve where the error is

 

 

Would you please be able to provide a suggestion and/or a sample that I can view and try to replicate?

36713.png

MATERIAL_ID SDPI

MATERIAL_ID Cognos

Match?

LCD8281101

LCD8281101

Yes

LCD8280901

LCD8280901

Yes

LCD8280801

LCD8280801

Yes

LCD8280701

LCD8280701

Yes

LCD8280695

LCD8280601

No

LCD8280601

LCD8280501

No

LCD8280501

LCD7521401

No

LCD7521401

LCD7521301

No

LCD7521301

LCD7521201

No

LCD7521201

LCD7521101

No

LCD7521101

LCD7521001

No

LCD7521001

 Wcode Review Manually

No




36714.png

MATERIAL_ID SDPI

MATERIAL_ID Cognos

Match?

LCD8281101

LCD8281101

Yes

LCD8280901

LCD8280901

Yes

LCD8280801

LCD8280801

Yes

LCD8280701

LCD8280701

Yes

LCD8280695

Any comment

No

LCD8280601

LCD8280601

No

LCD8280501

LCD8280501

No

LCD7521401

LCD7521401

No

LCD7521301

LCD7521301

No

LCD7521201

LCD7521201

No

LCD7521101

LCD7521101

No

LCD7521001

LCD7521001

No

 





Thank you

​​​

PvD_SE
Level 12
Hi Lorenzo,

From what I understand, you have tow collections: one for Cognos data and another for SDPI data. Both have a field called MATERIAL_ID. You want to compare the two collections by matching MATERIAL_ID between the two and write Yes or No in the MATCH? column, depending if a match was made or not.

You write that you loose a row in the comparison. I see no Delete Row action so all rows should be read and compared and none should be removed. As you first count the number of rows and then fill up the lesser collection with dummy rows, you should always have the same number of rows in the collections when you start matching them and therefor not loose any rows.

Your way of matching, by looping through one collection (main) and for each row check if that value also exists in the other collection (secondary), seems solid for your purpose. It will however NOT list any entries in the secondary collection that do not exist in the main collection.
In order to get them too, you might want to update the secondary rows that you were able to match with the main. When you're done, the secondary rows that were not updated represent your unmatched rows.

Hope this helps, otherwise explain more. 🙂

Happy coding!
Paul
Sweden
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)