• @force.ax1146
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

hi

 

my requirement is to add the rows & column values like

 

1 2 3  = 6

2 3 1  = 6

1 1 1 =  3

4 6 5

 

so i wrote code like this but will saving

 

 Error: Compile Error: Invalid type: objBudClass at line 19 column 40 . 

 

Can any one help on this issue.

 

Thank q .

 

 

 

public class GroupedQuery123

    public list<AggregateResult> lstAr = new list<AggregateResult>();
   
    public GroupedQuery123()
    {
        lstar = [SELECT Product_Service_Category_Poc__c, Case_Type_Poc__c ,
GROUPING(Product_Service_Category_Poc__c ) p1 , GROUPING(Case_Type_Poc__c ) p2,
COUNT(casenumber) tot1
FROM Case
where CreatedDate = THIS_WEEK and Status = 'open'
GROUP BY CUBE(Product_Service_Category_Poc__c , Case_Type_Poc__c )
order by GROUPING(Product_Service_Category_Poc__c ) , GROUPING(Case_Type_Poc__c )];

    }
    public list<BudClass> getResults(){
        list<BudClass> lstResult = new list<BudClass>();
        for(AggregateResult ar : lstAr){
            BudClass objBudClass = new objBudClass(ar);
            lstResult.add(objBudClass);
        }
        return lstResult;
    }
  
    class BudClass{
        public Double tot1{get;set;}
        public String p1 {get;set;}
        public String p2 {get;set;}
      
        public BudClass(AggregateResult ar){
        tot1 = (Double) ar.get('tot1');
           p1= (Double) ar.get('p1');
            p2= (String) ar.get('p2');
        }
    }

}