Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Data Validation

vijaylnyadav
8 - Asteroid

Consider the following sample data,

 

Roll noSeat numberSubjectMarksError or Warning
11111English89 
22222Hindi78 
33333Sanskrit98 
22222Hindi77 
11111English84 
44444Marathi76 
33333Sanskrit98 
66666Gujarati68 
22222Hindi71 
44444Marathi76 
22222Hindi78 
66666Gujarati66 

 

Condition: -

if roll no and seat no are same, validate subject and verify marks are different - Warning Message
If roll no & seat number are same, validate subject and verify marks are same - Error Message

 

Please suggest me a workflow or solution so that i can complete my assignment.

5 REPLIES 5
messi007
15 - Aurora
15 - Aurora

@vijaylnyadav,

 

Could you complete manually the column Error or Warning.

It will help to understand your needs.

 

Regards,

vijaylnyadav
8 - Asteroid

@messi007 

 

 

Roll noSeat numberSubjectMarksError or Warning
11111English89Warning
22222Hindi78Warning
33333Sanskrit98Error
22222Hindi77Warning
11111English84Warning
44444Marathi76Error
33333Sanskrit98Error
66666Gujarati68Warning
22222Hindi71Warning
44444Marathi76Error
22222Hindi78Warning
66666Gujarati66Warning

 

if marks are same then error and if marks are different then warning message for same roll number

leon2020
7 - Meteor

Interesting one to solve, sure there are many ways but here's my approach:

leon2020_3-1608718437152.png

 

 

Summarized by roll no and seat no, then concatenated subject and min/max marks for checking.  Note the concat has no comma separation - this will be a temporary field and used in a formula later to deduce if subject is validated.

 

leon2020_0-1608718317830.png

 

Then joined the output of that summarise tool to the original input, joining by seat no and roll  no, should result in 0 data from the L &R anchors and the same number of rows (12) in the Join anchor.  Following this, used the formula to create the Error or Warning field and select the desired columns for the final output/browse.  Attached workflow.

 

leon2020_4-1608718458329.png

 

 

 

 

 

 

 

 

vijaylnyadav
8 - Asteroid

@leon2020 can u please suggest some other solution for the same problem?

There is not harm in this solution but as you mentioned it can be solved by many ways.

Therefore, please suggest some another solution,

 

Thanks

leon2020
7 - Meteor

In the Summarize tool, you could Group By Roll no. and Seat no. and Count Distinct Subject and Count Distrinct Marks.  In hindsight, that might be a better approach!

 

The formula tool can then be adjusted thus:

IF [CountDistinct_Subject]=1 AND [CountDistinct_Marks]=1 THEN "Error: Subject and Marks are the same"
ELSEIF [CountDistinct_Subject]>1 THEN "Error: Subjects differ"
ELSE "Warning: Marks differ"
ENDIF

 

Then join the two together by specific fields roll no and seat numbers, selecting all the left fields and the right error or warning (assuming the left anchor is the original dataset and the right anchor is the output from the formula following the summarize).

 

Depending on how many duplications you may expect, you might order by seat number and roll number, and use a multi-row formula to check if the row above contains the same values for roll no, seat number, subject and marks.  This would also flag the first occurrence of each row/seat no, which you can either use or work around. 

 

 

 

Labels