Here , The data is like a “Name” has a number of “ID” assigned where “Work” has a value the “Status” is “Occupied” and if “Work” is blank then “Status” is “Available”.
“Duplicates” contain Count of ID’s occuring how many times
“NameCount” Contains count of ID’s that a name has
Problem Statement The output file is like
In the output file : if a name has 2 id’s where one id contain more than one row and if another id is available(contains no value of “Work”) then assign one of the duplicate value of work to another id which is available .
The main aim is to remove the duplicate ID’s and assign the value to ID which has same name but status is available. If no available then skip. The shifting of rows can only happen within a name.
Can anybody please help me how to solve this problem ?
For production level I suggest to enhanced it with some additional checks (e.g. 0 row return results handling etc.) Also I do feel that some exeption scenarios are to expect e.g. more duplicate groups as available free reows etc.)
Kindly note: 8 g 34, vs. 9 g 23 (implemented). XAML has implemented to select the 2nd row from the duplicate group and so it comes to this different output
@ppr because it is showing me the error “Assign: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index”
@Soniya215
Res.elementat(1) is fetching the Second element from a collection. For any reasons this Second element doesnt exists.therefore the issue.
I would suggest to Analyse the Data to find Out what is Happening and causing this. Then save IT Up with some Checks. This a typical Case for what i named “bringing IT Up to production Level”
Thanks @ppr i think the issue is that in some cases elementAt(1) is not present and in some cases it is present. What should i use to avoid that problem ?
Please help.
@Soniya215
Best would be to reformulate requirements Akin with Sample Data covering all different scenarios. With this the Implementation can be enhanced. Can you Share it? Thanks