Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

Transformation of column help

$
0
0

Hi,

 

I have a connection to a data source that is regularly updating with user entered data. One of the columns it brings in contains data in the following format:

 

{"Label1":"Value1","Label2":"Value2","Label3":"Value3"}

 

I need to transform this to the following:

 

RowLabel1Label2Label3
1Value1Value2Value3

 

The issue with this column is that while the format structure is the same the labels and values are variable.

 

So the next row could contain the following:

 

{"Label3":"Value3","Label1":"Value1","Label4":"Value4"}

 

So the data set should now look like:

 

RowLabel1Label2Label3Label4
1Value1Value2Value3 
2Value1 Value3Value4

 

Using Power BI's JSON parser was working fantastically to perform this task except until it encoutered duplicate values (user entered error but there's no validation control on the source) within the field:

 

{"Label3":"Value3","Label3":"Value3","Label4":"Value4"}

 

or if that field was blank it then returns errors.

 

Any ideas on a better way to do the transform?

 

Cheers,

Andrew.


Viewing all articles
Browse latest Browse all 213819

Trending Articles