NaderNouri Posted June 5, 2011 Posted June 5, 2011 hello to everyone, Here I attach a sample database. I want to design a report to shows Total_weight of each month. any help? Production.zip
NaderNouri Posted June 5, 2011 Author Posted June 5, 2011 Many thanks for the reply. It is very useful but what I need is a report which only shows cMonth and sTotal_Weight. Also I like to use them to make a chart. is it possible?
comment Posted June 5, 2011 Posted June 5, 2011 I need is a report which only shows cMonth and sTotal_Weight. Use a layout with no body part. It needs to be in List view - a Table view won't work for this.
NaderNouri Posted June 5, 2011 Author Posted June 5, 2011 Thanks a lot, it works great. if I may ask for more help? can we design cMonth to calculate from 20th of each month to 19th next month?
comment Posted June 5, 2011 Posted June 5, 2011 Make cMonth = Date ( Month ( Prod_Date ) + ( Day ( Prod_Date ) > 19 ) ; 1 ; Year ( Prod_Date ) )
NaderNouri Posted June 6, 2011 Author Posted June 6, 2011 Well my problem doesn't solve with this solution. I thing it needs more explanation. I attach the script which shows Persian Calendar range. what I need is cMonth sets for each range which is a persian month and shows in the report. is it possible?
comment Posted June 6, 2011 Posted June 6, 2011 I need is cMonth sets for each range which is a persian month That's very different from: design cMonth to calculate from 20th of each month to 19th next month I don't see what your script is supposed to accomplish. I'd suggest you add a table of PersianMonths, with fields for MonthName and MonthStart - then lookup the month name from there using a relationship. Or calculate the Persian month - IF you can find an algorithm you trust. See: http://fmforums.com/forum/topic/74931-i-need-solar-calendar-for-fm-how-can-i-get-it/page
NaderNouri Posted June 7, 2011 Author Posted June 7, 2011 I followed the link and got so happy because I find that you are very familiar with persian calendar. I will explain what i did till now. I created a table "Calendar" with two fields. 1-G_Date (date), 2-Sh_Date (Text)and made 365 records with equal date. I also created another table "Production" included bellow fields: Prod_date Device_name Prod_name Prod_QTY Prod_weight Operator_name I linked Prod_date to Sh_Date. I need a script to make a annual report of any of fields in Production table while using Calendar table. as you suggested, I have to create cMonth, but I don't know what should the calculation be and how to use any of Prod_date, G_date or Sh_Date. kind regards
comment Posted June 7, 2011 Posted June 7, 2011 The "secret" for grouping records in a report is to have a field with a value that is common to all records in the group. In my example, the cMonth field returns the date of January 1, 2011 for all records in that month. If your Calendar table were built like: GregorianDate PersianMonth ... 2011-5-19 1390-02 2011-5-20 1390-02 2011-5-21 1390-02 2011-5-22 1390-03 2011-5-23 1390-03 2011-5-24 1390-03 ... you could group your records by the related Calendar::PersianMonth field - after defining a relationship matching: Production::Prod_date = Calendar::GregorianDate
NaderNouri Posted June 9, 2011 Author Posted June 9, 2011 Thank you a lot. I got my answer and it doing so fine. 1
Recommended Posts
This topic is 4974 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now