Data Flow - Parsing Rows with Expression Builder

Moore, Payton E 101 Reputation points
2021-03-11T00:16:46.453+00:00

Working through parsing data in Synapse using data flows. Here is my data flow thus far :

76503-dataflow.jpg

Here is a sample of the data prior to using a derived column to parse through each of the records:
76504-resourcename.jpg

Here is what my data looks like once I use these expressions below to parse through the data. The expressions work fine except on a few case scenarios (highlighted in red). I've attempted using iif statements as well usecase(), but am not getting exactly what I'm wanting to see.
Expressions :
Column Expression
Location substring(Resource, 0, instr(Resource, '') - 1)
Asset substring(Resource, instr(Resource, '
')+1, instr(Resource, '.') - (instr(Resource, '_')+1))
Attribute substring(Resource, instr(Resource, '.')+1, instr(Resource, '-VAL') - (instr(Resource, '.')+1))

76397-parse.jpg

Here is what I would like to create using the expressions :

76513-parsefuture.jpg

I'm thinking to catch these different records the location expression should include something along the lines of : if ResourceName shows a "." before a "" , then split at ".", else split at "". If you have any direction, I would really appreciate the help. Thank you.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,373 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
Community Center Not monitored
{count} votes

Accepted answer
  1. MarkKromer-MSFT 5,226 Reputation points Microsoft Employee Moderator
    2021-03-11T19:36:13.46+00:00

    Do this all in 1 single Derived Column:

    Step 1: Create a new local var like this: regexSplit(Resource,'\s|_|\.|-')
    Step 2: Location = :local1[1]
    Step 3: Asset = iif(size(:local1)<3,toString(null()),:local1[2])
    Step 4: Attribute = iif(size(:local1)<3,:local1[2],:local1[3])


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.