• ScottishCalvin
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Ok, so the end goal I have is a chart showing the % changes from a start position over time from a starting position so:

Jan 1st    800    

Jan 2nd   837  +4.6%

Jan 3rd    783  -2.1%

Jan 4th    845  +5.6%

Jan 5th    847  +5.9%  ... and so forth

 

I could then plot these values cumulatively to show the %change from the original value over time

 

The problem is that the PREVGROUPVAL only allows you to look 12 steps back which is great for month by month summaries but I was wanting a lot more than that so that I could do a day by day movement and chart it on a rolling 90-day basis.  If these weren't percentages, you could just use the day-to-day change and plot them cumulatively but I'd rather show the percentages so that I can compare equally between people. That means I need to be able to reference the earliest row in the summary report

 

I was sort of thinking you could do it by seperating the first row off with a TRUE/FALSE field and then bringing the previous Parent function into the formula but I don't think you can do that sort of formula-based split in the reports (I can't see Date as a summary field to use in a formula).  I could set it to update as an APEX job schduled to run each day but I'd rather check whether I can do it in the report via formulas before I set off on that route unnecessarily?

 

Hi, sorry, a totally newby question that I can't seem to totally fully answer.

 

I was and am totally sold on the salesforce idea.  It's fantastic for developping and maintaining contacts for a newsletter a friend and I have developped.  On the other hand, we want to take some of the data that would otherwise be in a PDF and have it as a nice online report and set of charts for subscribers to browse through or contribute to.

 

The latter of these seems like a Force.com thing with custom objects, user dependant dashboards, a site, and from what I can tell, developping or writing triggers on Salesforce is a no-go once you have a production account.  But then Force.com also has Contacts and Accounts so is Force.com just a better or more maliable version of Salesforce with less crm stuff and more ability to develop?  It would seem that it's cheaper but justifies that with the fact that if you want all that extra cool CRM stuff, you need to pay more for a CRM specific setup or alternatively develop it yourself.  Or have I misunderstood things?

 

I wonderred if they're two different but complimentary tools, like a cooker and chopping board, in which case is there a way that you're supposed to set Force.com to automatically sinc it's contacts with your seperate Salesforce account?  Then you have a CRM system to manage sales and a Force.com app/site for your contacts to be able to access if they're an account.   ?

 

Just starting to delve into the SF world; getting the feeling there's a lot of good resources, once you get over the initial steep learning curve.

 

I'm wanting to add a trigger so that when a new set of inventory and price are added, the system adds in the previous figures added in.  That way you can calculate the movements and plot out the results as an up/down pattern.

 

I thought I can then scan through each of the entries and copy the previous price and inventory into the next entry as the "previous price" etc.  That means I could add formula fields like 'large increase' or flag things for review.  Yes the end result could be done by comparing the dates modified but I want the ability to backfill the data at a later date so I need to be able to loop through the list in order of delivery date (date is a custom field in the object btw).

 

I think I'm right in saying that I can't do a sort on a custom object though.  I suppose that the for() loop might not necessarily go from start to finish or top to down if you know what I mean.  I'm not sure where I go from here or if my bet bet is to make a new list, fill it with the dates, sort that and then run the two against each other?  This is what I had so far

 

Trigger FetchPreviousDaysInfo on Delivery_Data__c (before insert, after update )
{
List <Delivery_Data__c> DeliveryData =
[
Select
ii.Date__c,
ii.Price__c,
ii.Stocks__c,
ii.Previous_Price__c,
ii.Previous_Stocks__c
From Delivery_Data__c ii
For Update
];

DeliveryData.sort(DeliveryData.Date__c);

 

Double LastPrice = 0;
Double LastStocks = 0;

 

for(Delivery_Data__c TheEntry: DeliveryData)
{
     if (LastPrice <> 0)
     {
         TheEntry.Previous_Price__c = LastPrice;
         TheEntry.Previous_Stocks__c = LastStocks;
     }
     LastPrice = TheEntry.Price__c;
     LastStocks = TheEntry.Stocks__c;

}

 

update DeliveryData;
}

 

Mac Mini running OSX 10.5.8

 

Ok, so I'm getting the

"The eclipse executable launcher was unable to locate its companion shared library"

error that seems to be a bit common.  I had a look online and it said there was a quick fix by adding a line to eclipse.ini (within the .app file) but when I went there with the terminal, the only file I get in within /OSX/ is one called "redirect to install"

 

Is there someplace else I should be looking?  I'm still not terribly hot with OSX yet, having been raised on PCs, so any other technical advice Re editing or amending file permissions permisions in terminal would help.

 

Just starting to delve into the SF world; getting the feeling there's a lot of good resources, once you get over the initial steep learning curve.

 

I'm wanting to add a trigger so that when a new set of inventory and price are added, the system adds in the previous figures added in.  That way you can calculate the movements and plot out the results as an up/down pattern.

 

I thought I can then scan through each of the entries and copy the previous price and inventory into the next entry as the "previous price" etc.  That means I could add formula fields like 'large increase' or flag things for review.  Yes the end result could be done by comparing the dates modified but I want the ability to backfill the data at a later date so I need to be able to loop through the list in order of delivery date (date is a custom field in the object btw).

 

I think I'm right in saying that I can't do a sort on a custom object though.  I suppose that the for() loop might not necessarily go from start to finish or top to down if you know what I mean.  I'm not sure where I go from here or if my bet bet is to make a new list, fill it with the dates, sort that and then run the two against each other?  This is what I had so far

 

Trigger FetchPreviousDaysInfo on Delivery_Data__c (before insert, after update )
{
List <Delivery_Data__c> DeliveryData =
[
Select
ii.Date__c,
ii.Price__c,
ii.Stocks__c,
ii.Previous_Price__c,
ii.Previous_Stocks__c
From Delivery_Data__c ii
For Update
];

DeliveryData.sort(DeliveryData.Date__c);

 

Double LastPrice = 0;
Double LastStocks = 0;

 

for(Delivery_Data__c TheEntry: DeliveryData)
{
     if (LastPrice <> 0)
     {
         TheEntry.Previous_Price__c = LastPrice;
         TheEntry.Previous_Stocks__c = LastStocks;
     }
     LastPrice = TheEntry.Price__c;
     LastStocks = TheEntry.Stocks__c;

}

 

update DeliveryData;
}

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.