• hsia as saksie
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
q = load "i2i_Opportunities_with_Accounts_and_Users";
q = filter q by 'StageName' in ["2-Align", "3-Consensus", "4-Negotiate", "5-Pending Contract"];
q = group q by rollup('OwnerId.Name', 'StageName');
q = foreach q generate
    (case
        when grouping('OwnerId.Name') == 1 then "All Reps"
        else 'OwnerId.Name'
    end) as 'OwnerId.Name',
    (case
        when grouping('StageName') == 1 then "Total for Reps"
        else 'StageName'
    end) as 'StageName',
    sum('TCV__c') as 'sum_TCV__c';
q = order q by 'OwnerId.Name' asc;
q = limit q 2000;

This code give me the chart below but would love to summarize the stage columns at the bottom.

User-added image