How to do pivot Column to rows

Mahulima
Mahulima Contributor
edited December 2023 in General

I have rule1, rule2, rule3 in the column names and corresponding count in the rows, now I want to get the result as Column Names : Rule, count


How I can achieve this?

Tagged:

Answers

  • Josh Boxer
    Josh Boxer Administrator

    Currently there is not a Pivot step natively in the product, but I am aware of a Custom Step that has been created to achieve this. I have added another vote to the backlog request to add this functionality.

    However, you might not need to pivot as the Validate step has outputs that contain the Rule name in a column so you could filter the metric name column for say Failed rows to get the count for every rule.

    image.png

    (Note there was a change to these outputs in 2.2.5 if you are using an older version)

  • Mahulima
    Mahulima Contributor

    This is what I have , I have come to the counts by multiple group step and then collecting the stats from different channels by joins

    image.png

    And I want to convert this to like below;

    image.png


  • Mahulima
    Mahulima Contributor

    @Sueann See My requirement is to get the number if companies which has atleast one contact with email and mobile, One company has multiple contact, I used Validate step to get the contacts which has email and mobile, then used filter on the rules based on the rule flag Pass, after that Used group to get the count of the unique companies, similarly I had other rules and similar way I used filter for that rule and again group to get the company count for that rule. I had six different rules and I got the company count for 6 different group result and then at the end I used joins to get all the company count in one report, Now I want Pivot by rules so that I can show in One Trend Chart Otherwise I have to create 6 different trend chart for 6 different rules

  • Mahulima
    Mahulima Contributor

    @Sueann See Thank You very much! Grouping before validate will not work in my case and also Union will not work because I need to show as report in one row as well. And I have 10 rules so in that case If I need to add union additionally they I might need multiple unions just to achieve the trend in one chart which will make the workflow heavy and complex. But thank you so much for your help. For the time being I am doing in different charts and showing in one single report.

  • Pivot seems to be quite common requirement. Business users are used to Excel pivoting and its useful way to dynamically create two dimensional comparisons. Especially during development and ad hoc cases its a productivity problem if you have to move data to different tool like PowerBI and use its pivot while exploring data and building workflows in Aperture. Its also security and privacy issue. Moving all data that is needed for analysis from tool to another might not be acceptable. Only protected data conforming to local data policies can be moved to PowerBI.