Alteryx Designer Desktop Discussions

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

Splitting JSON string in Excel into several columns

tuiv
5 - Atom

Hi all,

 

I have a JSON string in my Excel file (that also needs to be sanitized e.g., " instead of ').  It is a string with 23 items and I need to separate them into single columns.

 

{'_type': 'snscrape.modules.twitter.User', 'username': 'AineHrElephant', 'id': 1088039862467510273, 'displayname': 'The HR Elephant', 'description': 'We want to Embrace, Educate & Enable every business on this island to effectively lead & guide their ‘herd’ to success!\nTel: +44 ...'}

 

Type'usernameiddisplayname...
snscrape.modules.twitter.UserAineHrElephant1088039862467510273The HR Elephant...
...............

 

I have tried to parse the JSON string as well as text to columns but it did not work. Especially for latter I set the delimeters for "," and ":" by using two "text to column" items but due to the high amount of 23 items it is quite a lot of work. 

 

Can someone help? 

 

Thanks,

Tui 

3 REPLIES 3
Luke_C
17 - Castor

Hi @tuiv 

 

How about updating the double quotes and using a JSON Parse tool? Seems to give good results.

Luke_C_0-1646336358025.png

 

 

tuiv
5 - Atom

Hi Luke,

 

thanks. I already tried this but have the problem that I have individual rows per ites now instead of one column for _type, one column for username, one column for id etc.

 

Any function I can use here?

 

tuiv_0-1646337530249.png

 

Luke_C
17 - Castor

Yes @tuiv , use a cross tab tool. Noticed your screenshot seems to show a 2nd record, so I added a record ID to group this. 

 

I'd suggest taking a look at the interactive lessons in the learning section of the community.

 

Luke_C_0-1646337772630.png

 

Labels