0

Modeling JSON Data

I have a data source that pulls a JSON file from Lever and need to set up a modeled table.
Tag 1 should pull data/tags[1] and Tag 2 should pull data/tags[2]

The problem is that all of the names do not have tags entered and the data is out of sync.
Can't use KF:fill_elements on the array and for the life of me, I can't figure out how to utilize “preciding-sibling” to solve the question like I saw in another post.

https://support.klipfolio.com/hc/en-us/community/posts/216282988-How-to-Lookup-with-Join-in-JSON-Array

 

 

1 comment

  • 0
    Avatar
    Janice Janczyn

    Hi Jeff,

    To use the LOOKUP approach, you need a unique value for each record, such as name . In this case, you need to use following-sibling because alphabetically tags follows name:

         LOOKUP( @/data/name,
                          @/data/name[following-sibling::tags[1]],
                          @/data/tags[1] )

    If the field you wanted to LOOKUP alphabetically preceded name, you would use preceding-sibling (note the spelling) instead of following-sibling.

    I hope this helps!

    Janice

Please sign in to leave a comment.