+ Reply to Thread
Results 1 to 10 of 10

Powerquery Help to help extract values from JSON data

  1. #1
    Forum Contributor
    Join Date
    10-18-2016
    Location
    Chicago, USA
    MS-Off Ver
    Office 365
    Posts
    220

    Red face Powerquery Help to help extract values from JSON data

    Hi All,

    Hope you are doing well! I seek your help in extracting the JSON data in column in column info in the attached excel worksheet (Input)..I need to extract chargeCode,diagnosisCode,modifiers,hcpcsUnits from the info column...The first json row order by created ascending order with the pair of Billid and ctextid is done by coder and the second by auditor.. Can you please help here.. Attached the excel worksheet with the output expected in the second sheet...

    Thanks,
    Arun
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Powerquery Help to help extract values from JSON data

    this will be of use to you:

    https://support.microsoft.com/en-us/...a-50dded6e4a68

    so will this:

    https://support.microsoft.com/en-us/...1-63f26a86c0eb

    and if you have advanced coding skills, the REGEX() function is incredibly useful in a scenario like this:

    https://docs.microsoft.com/en-us/dot...n-object-model

    but if the coding skills are limited, just loop the sheet from top to bottom and use string functions to find everything you need:

    https://docs.microsoft.com/en-us/dot...ring-functions

    INSTR() will be of utmost importance.

    these are coding solutions though. I'm no PQ expert. if it can do it, then that would obviously be easier.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Powerquery Help to help extract values from JSON data

    The OP has asked for a PowerQuery solution, Adam - it's in the thread title.

    I've asked before for a Power Tools forum section, but to date the tech team have not provided us with one. That's why we get PQ questions in all forum areas!
    Last edited by AliGW; 12-22-2020 at 08:58 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Powerquery Help to help extract values from JSON data

    I realize that ali, but why not give other things? many ways to skin a cat. you know that.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Powerquery Help to help extract values from JSON data

    Fair enough. Perhaps if you actually showed the OP how to do it using the method you've proposed, then? That really would be helpful.

    I'm just about to look at a PQ solution - will post back later.

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Powerquery Help to help extract values from JSON data

    Please try

    HTML Code: 
    Attached Files Attached Files

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Powerquery Help to help extract values from JSON data

    Nice one, Bo_Ry!

    Please Login or Register  to view this content.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Powerquery Help to help extract values from JSON data

    If you want VBA like your first thread
    Compare JSON data and splitting into corrected codes, deleted codes and added codes
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    10-18-2016
    Location
    Chicago, USA
    MS-Off Ver
    Office 365
    Posts
    220

    Re: Powerquery Help to help extract values from JSON data

    Thank you so much @Bo_ry and @Jindon..Appreciate your help!!...

  10. #10
    Forum Contributor
    Join Date
    10-18-2016
    Location
    Chicago, USA
    MS-Off Ver
    Office 365
    Posts
    220

    Re: Powerquery Help to help extract values from JSON data

    Thanks AliGW!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Extract JSON Data values and identify the differences
    By chandramouliarun in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-05-2020, 11:48 PM
  2. Extract JSON Data values and identify the differences
    By chandramouliarun in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-03-2020, 02:03 PM
  3. [SOLVED] Unable to make Powerquery extract data correctly onto an Excel sheet
    By Doofus1 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 11-21-2020, 04:24 PM
  4. [SOLVED] Extract Specific Column Information from JSON Column
    By chandramouliarun in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-31-2020, 03:47 PM
  5. Automate Powerquery JSON File Import with VBA
    By Chris.Leo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2020, 11:26 AM
  6. Edit JSON parser code to add function to write JSON file
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-16-2020, 09:28 PM
  7. Macro JSON file object extract
    By yousufj56 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2017, 07:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1