Forum Discussion
The easiest way (but not professional way) to do this-
1.use copy snap and make three output view.
2. use one mapper with value of CloumnC and count var=1. (make use target value for all ColC,ColD,ColE should remain same. )
3. use one mapper with value of CloumnD and count var=2
4. use one mapper with value of CloumnE and count var=3
5. Use union to marge all 3 views.
6. Use sort snap by count variable.
Thank you @Spiro_Taleski. That would work, but I also need to run the Data Validator snap on other fields as well.
I have managed to work around the issue for now by using a Conditional snap before the Data Validator that checks for null values in the $DOB field and transforms them to an empty string ‘’. Then use the this regex that matches either an empty string or the date: ^$|\d{1,2}/\d{1,2}/\d{4}$
While the Conditional snap may work in this case, I would also recommend looking at the Mapper snap with the following $.get expression as an alternative for the same:
(Note: Pass through is checked so that the only fields you need to concern with are those you need to run through the validator as a string.)
I don’t know that it’s a huge benefit, but it seems cleaner/easier to me and it allows for additional transformations/mappings on other fields in the same snap.
Helpful tip: In this forum, you can use the
icon to encapsulate code to preserve formatting
^$|\d{1,2}/\d{1,2}/\d{4}$
Related Content
- 2 years ago
- 3 years ago
- 5 years ago