[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

556.0. "A different problem..." by REPROT::GARMCS::MCSHANEG (Deceptively Co-Operative) Mon Jul 19 1993 06:50

    Hi,
	I'm trying to do something a little different and it's getting to  
        the stage where my brains are falling out in an effort to do what  
        seems likea simple task!

        I have two data files, one containing line items and one containing 
        totaled values related to the line items by way of a key. I'm      
        trying to produce a report which shows the various line items and  
        provides a sub-total by this key, however this sub-total must also 
        include the associated value from the first file.

        File A                      File B
        key     Value               key    Value
        --------------              ------------ 
        A12345  100.00              A12345 99.00 
                                    A12345 67.00
                                    A12345 100.01


        The report should be something like....

        A12345   99.00
                 67.00
                 100.01
                 100.00         <----------- From file A
                 -------
                 366.01

        Any suggestions would be appreciated.

        Thanks, Gary.
              
    
T.RTitleUserPersonal
Name
DateLines
556.1a suggestionDEMAND::MADDENMon Jul 19 1993 11:414
    this looks like a job for the MATCH FILE command,  unless the files 
    	have the same layout, then you could simply append them.
    
    	Richard
556.2DECODE Values ?PEKING::MCSHANEGDeceptively Co-operativeTue Jul 27 1993 06:2023
    Richard, 
    
    	Thanks for your quick reply....it's a case of if it was a dog it
    would have bitten me!....however...there always a however....I've used
    MATCH ok to create a hold file with both OLD_AND_NEW and have managed
    to produce a report of sorts...
    
    The report is a ledger based thing where the element I'm trying to display
    from FILE A (basenote) is a carried forward figure and as such must, as 
    well as being included in a total, be displayed seperatly...I've managed 
    to do this by using RECAP but it's still not 100% and a little confusing.
    
    I recon I could probably work around this if there were a way of using
    DECODE to convert the key into it's associated value, but DECODE doesn't 
    seem to like the idea of this and I keep getting a 272 FORMAT ERROR IN
    DECODE ELEMENT error....I even tried converting the values with EDIT and 
    creating a hold file to use with DECODE but the decimal points and the 
    signs on the values are lost...
    
    Any ideas would be appreciated....
    
    Thanks, Gary.
      
556.3try thisDEMAND::MADDENTue Jul 27 1993 16:247
    It sounds like what you would like to do is distinquish the A12345
    value from file A from the A12345 values from file B so you could
    define a display field based on the difference.   What I would need is 
    an additional field with an A or B value.   try creating it with a 
    define in the match file process.......
    
    richard
556.4Ta.PEKING::MCSHANEGDeceptively Co-operativeSun Aug 01 1993 20:318
    Richard,
    
    	Yup, that works, I generated a new field based on the value of the
    'odd' element in the first file and used this as before with the RECAP
    statement. Thanks v much for your help...
    
    Gary..