0

Json data align issue

Hi, 

I am struggling with align data with respect to date. Here "Actions" is not available in all array elements and also this particular action_type is not available in all "Actions".

I tried mentioned code and also with kf:fill_elements, but didn't correct result.

Kindly help to fix it.

3 comments

  • 0
    Avatar
    Adam Doogan-Smith

    Hi Manu!

    Here is a handy tutorial on how to align Facebook Ads data with xpath including actions and dates: https://support.klipfolio.com/hc/en-us/community/posts/115002788074-Manipulating-Facebook-Data-with-Xpath

    Happy Dashboarding!

    Adam

  • 0
    Avatar
    Manu Goyal

    Thanks for reply.

    It solves for one xpath only.

    But issue is, I am working on bar chart and have many series, then how to apply different condition on one X-axis. 

    Kindly explain what is the formula on x-axis and series.

  • 0
    Avatar
    Adam Doogan-Smith

    Hi Manu,

    If you want to return all your dates on the x-axis, but align the actions properly you need to use LOOKUP()results referenceGROUP() and GROUPBY().

    For example:

    LOOKUP(&X-Axis,

    GROUP(/data/actions[action_type='action_name']/following-sibling::date_start),

    GROUPBY(/data/actions[action_type='action_name']/following-sibling::date_start,
                     /data/actions[action_type='action_name']/value))

    You can replace "action_name" with the specific name of the action you want to return.

    Hope this helps!

    Adam

Please sign in to leave a comment.