Stonefield Query
 
Stonefield Site Map
Stonefield Support

  Overview
  Submit Support Ticket
  Forums
  Online Help Files
  Services
  Pre-Sales Support
Online Webinars
Video Demonstrations
Feature Requests
  Software Maintenance
  Support Testimonials
  FAQ's
Quick Links
Buy Now!
Download Free Trial
Watch a Video
Contact Us

 
 You are here: Support * Support Forums   Search

 Stonefield Query Support Forum

Welcome to the Stonefield Query Support Forum. Please note that in order to participate in the support forums, registration at our site is required. If you are already a member of our site, please sign-in.

 

Subject: Sum field in Detail records

You are not authorized to post a reply.   

Author Messages
kiwi
Posts:4

07/29/2008 1:02 AM Alert 

Hi

I have customers that have sales recorded as Details in Goldmine eg "2008 Sale". Customers may have more than one detail record and there is a field in the record that has the Qty sold. So if a customer has 3 "2008 Sale" Details each with a qty of 5 I just want one line saying total quantity 15. I have tried many conbinations of grouping, etc but can't get the result I am looking for.

I would like to create a report with the following layout:

Customer       Total Qty 

Customer A         15

Customer B         20

Is this achievable? Thanks

 

tmansuy
Posts:161

07/29/2008 9:09 AM Alert 

The summary report option makes this type of report very simple. Just group on customer, sum on the detail quantity, and then in step 5, turn on the "Summary Report" checkbox. This will supress the listing of each quantity, and only show the total per group (customer), as you describe.

 

Trevor

kiwi
Posts:4

07/29/2008 4:03 PM Alert 

Thanks - I was on the right track however your answer has clarified my real problem!

The qty field is a detail record field (which isn't numeric) therefore the "sum" option isn't available. Had a  look at converting the field using an expression but haven't had any success. Can I do this? The values in this field are all whole numbers eg 1, 5, 10, etc

tmansuy
Posts:161

07/29/2008 4:48 PM Alert 

What you need to do here is change the underlying field type in the Stonefield Query data dictionary. This topic is discussed in the help file under How To->Customizing the Stonefield Query Data Dictionary.

For this particular task, you need to create a setup.sqs file (in the program folder where sfquery.exe is). The code to achieve what you are looking for will be something like:

 

loField = SQApplication.DataEngine.Fields.Item('XXDETAIL.TITLE')
loField.Type = 'N'
loField.Length = 10
loField.Calculated = .T.
loField.Expression = 'VAL(TITLE)'

XXDETAIL is the name of the table internally, and Title is the name of the field. You can get this information by turning on "Display Real Table and field Names" (Tools->Options), and viewing the detail field in the quick report wizard. That is really the only line you should have to change. The other lines change the field type to numeric, length 10. The last line is a simple VFP expression that takes the underlying character value stored in the field (TITLE in my example, you may have to change this), and converts it to a numeric value.

Trevor

kiwi
Posts:4

07/29/2008 7:26 PM Alert 

thanks - that worked a treat

You are not authorized to post a reply.



ActiveForums 3.6

 
 
   Privacy Statement  |  Terms Of Use
© 1996-2008 Stonefield Software Inc. All rights reserved.