How to separate semicolon delimited values to separate columns Yoel Kortick Senior Librarian http://continuumgrc.com/infinite-library/
Introduction The regular expression Example with course instructor Example with ISBN http://image.shutterstock.com/z/stock-photo-business-hand-writing-blank-agenda-list-130255148.jpg http://s3.thingpic.com/images/zp/timHgbybX5e9UqMUf6oYyVQM.jpeg
Introduction In Alma Analytics when there is a “one to many” relationship in one entity then the “many” values will often appear all together in one field delimited with a semicolon. For example: One “course name” may have multiple “course instructor” values One “bibliographic title” may have multiple “ISBNs”
One “course name” may have multiple “course instructor” values Introduction One “course name” may have multiple “course instructor” values Two instructors separated by a semicolon Four instructors separated by a semicolon
One “bibliographic title” may have multiple “ISBNs” Introduction One “bibliographic title” may have multiple “ISBNs” Two ISBNs separated by a semicolon Four ISBNs separated by a semicolon
Introduction It is possible, if desired, to have these “semicolon separated” values appear as separate columns. This can be useful for display and filtering purposes. While there are multiple ways in which this can be done, we will show here the use of the “regular expression”. This is perhaps the easiest method to use. As we will see it involves merely pasting the regular expression and then changing the column name and numerical value
Introduction Instead of this We will get this
Introduction Instead of this We will get this
Introduction The regular expression Example with course instructor Example with ISBN http://image.shutterstock.com/z/stock-photo-business-hand-writing-blank-agenda-list-130255148.jpg http://s3.thingpic.com/images/zp/timHgbybX5e9UqMUf6oYyVQM.jpeg
The regular expression – Syntax The syntax of the regular expression is as follows. The user needs merely to the change the red and green parts below. The “n” is the column number (occurrence of the value between the semicolons) The “Column”.”Name” is how the column appears by default when doing “edit formula” Evaluate('regexp_substr(%1,''[^\;]+'', 1,n)',REPLACE("Column".“Name",';','\;')) Occurrence of value Name of column as it appears in “edit formula”
The regular expression – Course Instructor In order to make the first column for the course instructor the regular expression is Evaluate('regexp_substr(%1,''[^\;]+'', 1,1)',REPLACE("Course"."Course Instructor",';','\;')) In order to make the second column for the course instructor the regular expression is Evaluate('regexp_substr(%1,''[^\;]+'', 1,2)',REPLACE("Course"."Course Instructor",';','\;')) In order to make the third column for the course instructor the regular expression is Evaluate('regexp_substr(%1,''[^\;]+'', 1,3)',REPLACE("Course"."Course Instructor",';','\;'))
The regular expression – ISBN In order to make the first column for the ISBN the regular expression is Evaluate('regexp_substr(%1,''[^\;]+'', 1,1)',REPLACE("Bibliographic Details"."ISBN",';','\;')) In order to make the second column for the ISBN the regular expression is Evaluate('regexp_substr(%1,''[^\;]+'', 1,2)',REPLACE("Bibliographic Details"."ISBN",';','\;')) In order to make the third column for the ISBN the regular expression is Evaluate('regexp_substr(%1,''[^\;]+'', 1,3)',REPLACE("Bibliographic Details"."ISBN",';','\;'))
Introduction The regular expression Example with course instructor Example with ISBN http://image.shutterstock.com/z/stock-photo-business-hand-writing-blank-agenda-list-130255148.jpg http://s3.thingpic.com/images/zp/timHgbybX5e9UqMUf6oYyVQM.jpeg
Example with course instructor In the criteria tab add the field for however many times you want a separate column We will have four columns of course instructor
Example with course instructor For each column do “edit formula” then add the appropriate regular expression
Example with course instructor Instead of this (the default) First column Put this
Example with course instructor Second column Third column Fourth column
Example with course instructor Results show instructors in separate columns
Introduction The regular expression Example with course instructor Example with ISBN http://image.shutterstock.com/z/stock-photo-business-hand-writing-blank-agenda-list-130255148.jpg http://s3.thingpic.com/images/zp/timHgbybX5e9UqMUf6oYyVQM.jpeg
Example with ISBN In the criteria tab add the field for however many times you want a separate column We will have four columns of ISBN
Example with ISBN For each column do “edit formula” then add the appropriate regular expression
Instead of this (the default) Example with ISBN Instead of this (the default) First column Put this
Example with ISBN Second column Third column Fourth column
Example with ISBN Results show ISBNs in separate columns
Yoel Kortick Senior Librarian Thank You Yoel Kortick Senior Librarian http://continuumgrc.com/infinite-library/