Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

JSON file parsing

MinjiKim
5 - Atom

Hi.

 

I have a problem parsing a json file containing a matrix.

 

{"waferMap":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
...
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],"dieSize":1683.0,"lotName":"lot1","waferIndex":1.0,"trianTestLabel":[["Training"]],"failureType":[["none"]]}

 

This is one line in the JSON file I have.

I loaded this JSON file with the "Input Data" block. As a result, the matrix corresponding to the waferMap was split as shown in the picture below.

 

alteryx1.PNG alteryx2.PNG

alteryx3.PNG

 

 

 

Here is the result I want:

waferMapdieSizelotNamewaferIndextrianTestLabelfailureType
[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
...
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]
1683.0"lot1"1.0"Training""none"

 

A matrix of waferMap represents an 26by26 resolution image.

 

How do I get these results?

4 REPLIES 4
mceleavey
17 - Castor
17 - Castor

Hi @MinjiKim ,

 

can you provide the JSON and a full example of what you wish to see?

 

M.



Bulien

danilang
19 - Altair
19 - Altair

hi @MinjiKim 

 

The JSON parse tool(or the Input Data tool, configured to parse JSON files) is very simple.  It splits the entire file into a single element per line.  There's no way to change this default behaviour.  If you want a different granularity, you can rebuild the pieces up from the individual elements, or import the file as text and parse it out using a combination of regex and formula tools.

 

Here's a solution that the uses the first approach. 

danilang_0-1637417482391.png

The JSON Parse tool is configured to output the data into typed fields, whihc makes the logic in the rest of the workflow a little easier.  The equivalent operation in the Input Data is to uncheck "Parse Value as String"  Then it's matter of rebuilding the matrix, adding the quotes back into the string fields and crosstabbing the output

 

danilang_1-1637417746256.png

 

Note that trianTestLabel and failureType can both be arrays.  If the you need to rebuild those as arrays, use a technique similar to the the first Summarize tool in the Rebuild Matrix container.

Dan

 

   

MinjiKim
5 - Atom

This is so helpful!

Thanks a lot

MinjiKim
5 - Atom

The size of the original file is very large, so it may be difficult to attach.
But thank you so much for your interest!

Labels