[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference ilbbak::ibi_focus

Title:FOCUS, from INFORMATION BUILDERS
Moderator:ZAYIUS::BROUILLETTE
Created:Thu Feb 19 1987
Last Modified:Mon May 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:615
Total number of notes:1779

391.0. "Generating a total to use as part of an operation" by WMOIS::B_REINKE (she is a 'red haired baby-woman') Tue Jan 22 1991 15:17

    I'm not sure how to describe what I need to do. I have
    a fex where I separate parts into a,b, or c class depending
    on their total dollar value. The a class parts make up
    80% of the total dollar value of shipped orders, the
    b class the next 15% (to 95% of the total of the dollar 
    value) and the C class the remaining 5% of the total (like
    a Parodi histogram).
    
    To do this I need to have the total dollar value of the shipped
    parts as part of my fex:
    
    eg
    define file <mumblefratz>
    95%total = .95 * 179426175;
    80%total = .80 * 179426175;
    running_tot = last running_tot + tot_shp;
    class_a_flag/a1= if running_tot ge 95%total then 'c' else
    if running_tot ge 80%total then 'b' else 'a';
    
    (part of this bit of code was the result of help I got here earlier..)
    
    
    how do I change the code so that I can get a sum of all the parts
    to automatically be entered where I now have the numbers?
    
    currently I just edit the fex to put the correct total in..
    
    i.e. I run it once, then read off the total and edit the fex
    and run it again..
    
    I'm being asked to pass the fex over to someone else to run and
    they don't want to have to edit it.
    
    Bonnie
T.RTitleUserPersonal
Name
DateLines
391.1HUMMINA, HUMMINA, HUMMINARUNTUF::IMFRATue Jan 22 1991 17:4341
    WELL, isn't THIS special!  
    
    Assumming (a lot) one has a file similar to the following:  
    
          PART_NO QTY EL_BUCKOS  
    
    
    define file partake 
      totpart_cst/some format = el_buckos * qty; 
      part_cst/some format    = el_buckos * qty;
    end 
    
    table file partake
      sum totpart_cst                      (used to total cost of all parts)
      sum part_cst                         (used to total cost of each part)
          by part_no 
      on table hold 
    end
    
    Now we have a hold file which contains each part number, its respective 
    cost for orders shipped, and the total for all parts shipped
    (totpart_cst) on each darn record. 
    
    table file hold 
    sum 
      compute part_type/a1 = if part_cst le (.8  * totpart_cost) then 'A' 
                        else if part_cst le (.95 * totpart_cost) then 'B' 
                        else 'C'; 
      by part_no 
    end
     
    
    Does this resemble, in any way, shape, or form, what were looking for?  
    
    
    I hope this adequately answers your FOC_SOS.
    
    Remember, my old standby, "this SCUD's for you!"
    
    -saddam 
                 
391.2WMOIS::B_REINKEshe is a &#039;red haired baby-woman&#039;Wed Jan 23 1991 16:026
    I dunno, I'll print it out and carry it off to my focus account
    and try it out..
    
    thankyou
    
    Bonnie
391.3WMOIS::B_REINKEshe is a &#039;red haired baby-woman&#039;Fri Jan 25 1991 08:2610
    What I really want, after trying this a bit
    
    is some way to do the following (which doesn't work)
    
    define file mumblefratz
    total = sum raw_mlp;
    and then insert total instead of the numbers in my previous
    example..
    
    bj
391.4...and a time to every purpose under Heaven.RUNTUF::IMFRAFri Jan 25 1991 12:4815
    
    I am not getting your drift.  I will need more concrete info in order
    to be of assistance.  My suggestion would be to (1) include your MASTER
    file description, (2) create (with an editor, if necessary) a report 
    (just a few lines) which shows what is desired -- map any pertinent
    fields back to the MASTER  -- if the mapping isn't obvious -- in text 
    following the report.
    
    Also, send the FEX which is currently run. 
    
    If you don't send this stuff (in a reply), I will seek you out and
    gouge your eyes out for wasting my precious time.  After that, you will 
    join the other Americans in swimming in their own blood!
    
    -Saddam
391.5WMOIS::B_REINKEshe is a &#039;red haired baby-woman&#039;Fri Jan 25 1991 13:094
    I'll send you the code, if you are for real. The style in
    which you write makes me think you are 'putting me on'.
    
    Bonnie
391.6Have Faith, my child.RUNTUF::IMFRAFri Jan 25 1991 14:0211
    
    I AM putting you on with regard to the "Iraqi humor", but not with
    regard to getting your question answered.  My first reply was a serious
    attempt to help you, but your subsequent reply made no reference to 
    my suggestions, and it didn't seem to correlate well with your initial 
    request for help.  
    
    Send the stuff I asked for and you will gain much wisdom. 
    
    -the Ishmir of Schmoe
       
391.7WMOIS::B_REINKEshe is a &#039;red haired baby-woman&#039;Fri Jan 25 1991 14:337
    I haven't tried doing what you suggested first, because
    if I can define a total it would be easier than rewriting
    my whole fex.
    
    I've sent you my fex, do you want to take this to mail?
    
    Bonnie
391.8I went to a church, I passed along the way.RUNTUF::IMFRAFri Jan 25 1991 15:518
    
    ah, roger, that's a big affirmative, switching to mail in t-minus  
    5
    4
    3
    2
    1
    ...gone
391.9WMOIS::B_REINKEshe is a &#039;red haired baby-woman&#039;Mon Jan 28 1991 14:145
    By the way, Joe (?) thanks, your suggestion works...
    
    I'll post the finished fex here for anyone who is intersted.
    
    Bonnie
391.10What workedWMOIS::B_REINKEshe is a &#039;red haired baby-woman&#039;Mon Jan 28 1991 14:1971
    Parts marked by the -* except the comments at the top were the
    suggestions that made the file run the way I needed it to.
    
OFFLINE CLOSE
VMS DELETE ABC.RPT.*
FILEDEF OFFLINE DISK ABC.RPT
-*
-* TO DETERMINE ABC RANKING BY DOLLARS SHIPPED
-*
-*
- PROMPT &CUR_MTH.A9.Enter reporting month:.
- PROMPT &ABR_MTH.A3.Enter abbreviation of reporting month:.
- PROMPT &COMP_MTH.A3.Enter abbreviation of comparision month:.
- SET    &FILENAME  =  'CUR'||'_'||&ABR_MTH;
- SET    &FILENAME1 =  &ABR_MTH||'V'||&COMP_MTH||'F';

DEFINE FILE &FILENAME
ACC/D3 = EDIT(PLANNER_ACCY);
END

TABLE FILE &FILENAME
PRINT PN PC ACC
BY PN
IF PLANNER_CODE EQ 20 OR 23 OR 25 OR 24 
ON TABLE HOLD AS PC
END
-*
-RUN
-*
JOIN PART_NUMBER IN PC TO PART_ID IN &FILENAME1
-*
DEFINE FILE PC
  MLP_TOT/D8 = RAW_MLP;
END
-*
TABLE FILE PC
SUM MLP_TOT
PRINT PART_NUMBER PLANNER_CODE ACC
BY HIGHEST RAW_MLP
IF PART_NUMBER NE '    '
IF RAW_MLP NE '   '
ON TABLE HOLD AS JT
END
-*
-RUN
-*
DEFINE FILE JT

95%TOTAL       = .95 * MLP_TOT;
80%TOTAL       = .8  * MLP_TOT;
RUNNING_TOT    = LAST RUNNING_TOT + RAW_MLP;
CLASS_A_FLAG/A1=IF RUNNING_TOT GE 95%TOTAL THEN 'C' ELSE 
                IF RUNNING_TOT GE 80%TOTAL THEN 'B' ELSE 'A';
END

TABLE FILE JT
SUM AVE.ACC BY CLASS_A_FLAG
PRINT PART_NUMBER  AS 'PART,NUMBER' 
      PLANNER_CODE AS 'PC'
      RAW_MLP      AS 'MLP' 
      RUNNING_TOT  
      CLASS_A_FLAG AS 'RANK' 
      ACC          AS 'ACCURACY'

BY CLASS_A_FLAG    NOPRINT
BY HIGHEST RAW_MLP NOPRINT 
HEADING CENTER 
"ABC DOLLAR RANKING FOR &CUR_MTH - CURRENT MONTH"
FOOTING
"TOTAL =<MLP_TOT>"
END
391.11The Forecast Calls for Pain!HAMSTR::BAMFORTHMon Jan 28 1991 14:225
    
    You're welcome, Bonnie.  That's one of the nice things about
    "multi-verb requests".   
    
    Joe