Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

RegEx Issue with missing responses

lyd_ucl
5 - Atom

Hi all,

 

I'm new to Alteryx, and jumping straight in with a RegEx problem. I've read a lot of examples, but I haven't found a solution for this yet, so proving a little challenging for me!

 

I am receiving data which is being exported from a survey, and unfortunately isn't in a great state. the biggest issue I have is with matrix responses, which come back as long lists with a separator. Two example responses below:

 

RESPONSE 1: University reputation: Very important | Programme reputation: Important | Facilities (i.e. library, work stations, research labs etc): Not important at all | Accommodation: Important | Employability: Very important | League Tables/ Rankings: Important | Social atmosphere/ extra-curricular: Very important | International mix of students: Important | Location: Important | Bursary opportunities: Not very important | Scholarship opportunities: Not very important

RESPONSE 2: Facilities (i.e. library, work stations, research labs etc): Not very important | Social atmosphere/ extra-curricular: Important | Bursary opportunities: Very important | Scholarship opportunities: Not important at all

 

So far, I've written the following:

.*University reputation:(.*),*\sProgramme reputation:\s(.*),*\sProgramme content:\s(.*),*\sFacilities:\s(.*),*\sAccommodation:\s(.*),*\sEmployability:\s(.*),*\sLeague Tables/ Rankings:\s(.*),*\sSocial atmosphere/ extra-curricular:\s(.*),*\sInternational mix of students:\s(.*),*\sLocation:\s(.*),*\sBursary opportunities:\s(.*),*\sScholarship opportunities:\s(.*)

*Earlier in the workflow I changed the | for comma and Reduced the length of the 'Facilities' title just for ease of processing)

 

This works for Response 1 (apart from a very minor comma issue!), but if someone hasn't completed the question, the response is not pulled. And so, Response 2 comes up with an error. I've included a results. The large majority of fields, therefore, come back with errors, as completition is really hit and miss...

 

REGEX-Issue.jpg

 

Is there a way to write the RegEx expression so if the value is not there, it simply moves onto the next possible response?

Or else, does anyone have a better way of tackling this?

 

Thanks so much!

2 REPLIES 2
CharlieS
17 - Castor
17 - Castor

I approached this without RegEx.

 

20190206-SurveyResponses.png

 

 

 

 

 

 

 

Check out the attached solution for an alternative example.

lyd_ucl
5 - Atom

That's great - and solved so quickly, thanks so much!!

Labels