Start Free Trial

Alteryx Designer Desktop Discussions

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

Converting JSON to Tabular

Sarath27
8 - Asteroid

Input

dqm_solution_execution_idrun_datedata_entry_tableFailed_DQ_Checks_CountFailed_DQ_ChecksDQ_Checks_InfoJSON
A1/30/2022AAB5MC_103,MC_502,MC_512,MC_514,MC_500{"rule_id":"MC_103","rule_name":","Break_Fields":""},{"rule_id":"MC_502","rule_name":"","":"Additional_Name_1"},{"rule_id":"MC_512","rule_name":"","Break_Fields":""},{"rule_id":"MC_514","rule_name":"","Break_Fields":""},{"rule_id":"MC_500","rule_name":"","Break_Fields":""}

 

Required Output

dqm_solution_execution_idrun_datedata_entry_tableFailed_DQ_Checks_CountFailed_DQ_Checksrule_idrule_namebreakfield
A1/30/2022AAB5MC_103,MC_502,MC_512,MC_514,MC_500MC_103Entries such as 'test', 'Dummy', 'NO USAR', 'DO NOT USE', '!DNC!', 'DNC', '*DNC*' are not allowed as a full value are part value in the String.Party_Full_Name
A1/31/2022AAB5MC_103,MC_502,MC_512,MC_514,MC_501MC_502Entries such as 'test', 'Dummy', 'NO USAR', 'DO NOT USE', '!DNC!', 'DNC', '*DNC*' are not allowed as a full value are part value in the String.Break_Fields
A2/1/2022AAB5MC_103,MC_502,MC_512,MC_514,MC_502MC_512Apply Free Text Language checksAdditional_Name_2
A2/2/2022AAB5MC_103,MC_502,MC_512,MC_514,MC_503MC_514Entries such as 'test', 'Dummy', 'NO USAR', 'DO NOT USE', '!DNC!', 'DNC', '*DNC*' are not allowed as a full value are part value in the String.Additional_Name_2
A2/3/2022AAB5MC_103,MC_502,MC_512,MC_514,MC_504MC_504Apply Free Text Language checksAdditional_Name_1

 

Is there any way we could achieve this in Alteryx workflow? I tried already, but first array in DQ_Checks_InfoJSON is getting transformed.

 

Sarath27_0-1652112604511.png

 

8 REPLIES 8
Luke_C
17 - Castor
17 - Castor

Hi @Sarath27 

 

Can you attach the workflow you attempted?

Sarath27
8 - Asteroid

Hi Luke,

 

Here it is

Luke_C
17 - Castor
17 - Castor

Hi @Sarath27 

 

How's this? I didn't really change anything outside of updating the data to have a pipe to make the text-to-column easier (I saw you had a pipe in there already, so maybe you already did this?). I also tweaked the second JSON input as it looked like it was missing the 'Break_Field' text.

Luke_C_0-1652114810140.png

 

 

Sarath27
8 - Asteroid

 

 

Luke_C
17 - Castor
17 - Castor

Hi @Sarath27 

 

There's no data - note the empty quotes highlighted below:

 

Luke_C_0-1652117960080.png

 

 

Sarath27
8 - Asteroid

Hi Luke,

Thanks much. Your logic works here! Its working. If there is anything in this, I will ask here. Thanks again.

Sarath27_0-1652122676876.png

 

Sarath27
8 - Asteroid

Hi Luke,

 

I have several data to be converted like this, but when I tried with this same logic I am getting rule_id concatendated in it. I also tried to find it with Unique tool, but still getting same issue. I included data with all the scenarios as an attachment, please try the same with your workflow.

Why I am getting like this below? I even tried with unique toll, but still same issue, please advice

Sarath27_0-1652183529833.png

 

 

solution_id is the relationship for all the rule_id, rule_name, break_fields.

 

 

Luke_C
17 - Castor
17 - Castor

Hi @Sarath27 

 

Most of your data seems duplicated. Putting a unique tool on all fields gives ~100 rows. A few notes as to why you may have seen this issue:

 

  1. The crosstab tool was set to concatenate data if multiple records existed for the groupings. Since there was a high volume of duplicate records, this happened.
  2. The solution_id field name changed, so you may have gotten an error because of that.

Check out this workflow and let me know how it looks. Don't forget to tag the solution if you're all set.

 

Luke_C_0-1652184884279.png

 

Labels
Top Solution Authors