You need to sign in to do that
Don't have an account?
John Angerami 16
Apex Data from Full Year to Fiscal Quarter
I was able to find code for a Guage report that I can put on a VisualForce Page but it is capturing Full Year and I need it to capture just Quarter.
Any suggestions?
Thanks!
Any suggestions?
Thanks!
public class GaugeChartController { public String userId {get;set;} public GaugeChartController(ApexPages.StandardController controller){ userId=userinfo.getuserid(); } public List<gaugeData> getData() { Integer TotalOpptys = 0; Integer TotalAmount = 0; Integer thisMonth = date.Today().month(); AggregateResult ClosedWonOpptys = [select SUM(Amount) totalRevenue, CALENDAR_MONTH(CloseDate) theMonth, COUNT(Name) numOpps from Opportunity where OwnerId =: userID and StageName = 'Closed Won' and CALENDAR_MONTH(CloseDate) =: thisMonth GROUP BY CALENDAR_MONTH(CloseDate) LIMIT 1]; List<gaugeData> data = new List<gaugeData>(); data.add(new gaugeData(Integer.valueOf(ClosedWonOpptys.get('numOpps')) + ' Opptys', Integer.valueOf(ClosedWonOpptys.get('totalRevenue')))); return data; } public class gaugeData { public String name { get; set; } public Integer size { get; set; } public gaugeData(String name, Integer data) { this.name = name; this.size = data; } }
Please mark it as Best Answer if it helps.
All Answers
Please mark it as Best Answer if it helps.