• satyareddyk
  • NEWBIE
  • 0 Points
  • Member since 2010

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

I'm using AggregateResult in order to return sum of shipments for every combination of customeregion,productfamily and year,here is the query i'm using
apex code:
public AggregateResult[] queryResult { get {return queryResult ;} set{ queryResult = value ;} }
public AggregateResult[] getschemalist22()
{
 queryResult = [select sum(shp_4000__c) salesshipments,sum(shp_4010__c) inventoryshipments,sum(sos_5000__c) salesoutshipments,Time__r.Years__c years,
   Customer__r.Region__c regions, JaguarProduct__r.Family__c families from FACT_LL__c
   group by Time__r.Years__c, Customer__r.Region__c, JaguarProduct__r.Family__c];
 return queryResult;
}

Now i required to display this aggregateresult in my visualforce page pageblocktable like

Customerregion       Productfamily        Year          Measures                                values

ASIA                             prodfamily1             2010         salesshipments                      2000
                                                                                          inventoryshipments                340
                                                                                          salesoutshipments                1090

 

NORTH AMERICA     prodfamily1            2010         salesshipments                      6100
                                                                                          inventoryshipments                900
                                                                                          salesoutshipments                5600

 

which displays 2 records with "sum of shipments for region asia,productfamily1,year 2010" and"sum of shipments for region northamerica,productfamily1,year 2010".

 

please specify if this is the right way to get aggregateresult,if yes please let me know how to display it in visualforce page

as desired or is there any other way to display the result.

Any help is much appreciated.

 

Thanks & Regards,

Satya.

I'm using AggregateResult in order to return sum of shipments for every combination of customeregion,productfamily and year,here is the query i'm using
apex code:
public AggregateResult[] queryResult { get {return queryResult ;} set{ queryResult = value ;} }
public AggregateResult[] getschemalist22()
{
 queryResult = [select sum(shp_4000__c) salesshipments,sum(shp_4010__c) inventoryshipments,sum(sos_5000__c) salesoutshipments,Time__r.Years__c years,
   Customer__r.Region__c regions, JaguarProduct__r.Family__c families from FACT_LL__c
   group by Time__r.Years__c, Customer__r.Region__c, JaguarProduct__r.Family__c];
 return queryResult;
}

Now i required to display this aggregateresult in my visualforce page pageblocktable like

Customerregion       Productfamily        Year          Measures                                values

ASIA                             prodfamily1             2010         salesshipments                      2000
                                                                                          inventoryshipments                340
                                                                                          salesoutshipments                1090

 

NORTH AMERICA     prodfamily1            2010         salesshipments                      6100
                                                                                          inventoryshipments                900
                                                                                          salesoutshipments                5600

 

which displays 2 records with "sum of shipments for region asia,productfamily1,year 2010" and"sum of shipments for region northamerica,productfamily1,year 2010".

 

please specify if this is the right way to get aggregateresult,if yes please let me know how to display it in visualforce page

as desired or is there any other way to display the result.

Any help is much appreciated.

 

Thanks & Regards,

Satya.