Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2004
    Posts
    57

    Unanswered: Formula Sorting Problem

    I'm having a problem with writting a formula for a report. I'm trying to output a price report of my inventory. The data is organized with inventory item number (PART.ARTIKEL_NR) and price symbol (PPRK.PREIS_KZ). Every time a price is changed in the database a new entry is created with a new timestamp (PPRK.ANLAGEDATUM).

    The formula that I'm using is as follows:

    {PART.ARTIKEL_NR} startswith 'NP'
    and
    {PPRK.PREIS_KZ} = 'C'


    I get out of the report more than one listing of the same inventory item (because the timestamp is different)

    Here's an example of my output:


    Artikel_NR Pries_KZ Anlagedatum
    NP 1 C 20040209
    NP 1 C 20040604


    I'd like to get only the latest (Anlagedatum) of (Artikel_NR) with the (Pries_KZ) = 'C' But I don't know how to do it, hopfully this is a simple thing that someone can help me out with.

  2. #2
    Join Date
    Jan 2004
    Location
    Jersey, UK
    Posts
    108
    You could create a new formula field and set the value to be the maximum date in that field, e.g.

    max(Anlagedatum)

    Then in your report replace Anlagedatum with your new Formula field (in Field Explorer). You should now find that the report only returns the latest record.


    Regards - Andy

    note: I might have missed something out here but I'm not running CR on this pc so can't test. Let me know if it doesn't work and I'll come back to you on it.

  3. #3
    Join Date
    Nov 2004
    Posts
    57

    Solution

    The solution that I found to solve the porblem was to create a subreport and pass the parameter into it to calcultate the maximal date. Then the subreport is inserted into the main repost and linked acourding to artikel number.

  4. #4
    Join Date
    Jan 2004
    Location
    Jersey, UK
    Posts
    108
    Cool. Well done to you then...!


    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •