Welcome to Forums Sign in | Join | Help | Forums
in Search


Summarize on RE field Currency_amount

Last post 07-31-2008 4:18 PM by William Da Silva. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 07-31-2008 2:02 PM

    • William Da Silva
    • Top 500 Contributor
    • Posts 36
    • Organization: Centraide Québec
    • Products:  The Financial Edge, The Raiser's Edge

    Summarize on RE field Currency_amount

    I need to insert a summary field on the Currency_Amount field (exported from RE with Export). Thing is that RE exports this field fully formatted, therefore it is a string field.

    Crystal cannot summarize on a string field, so I would need to convert it to a number (ex: ToNumber() ), however, because of the various countries and number formatting, crystal does not reccognize most strings as being numeric. Example, ToNumber will not work for "$ 1,000,000.00". To complicate things more, my report will include many different types of currencies (Euros, Yens, Pounds...). This means that I cannot just easilly use the replace function first.

    Any ideas?

     Thanks,

    William

     

    William da Silva
    eSimpleIT.com
  • 07-31-2008 2:24 PM In reply to

    • Drew Allen
    • Top 10 Contributor
    • Posts 514
    • Organization: Children's Hospital of Philadelphia
    • Products:  The Information Edge, The Raiser's Edge

    Re: Summarize on RE field Currency_amount

    Try CCur() instead.  It will automatically remove the "$" from your string.  I don't know what it does with euros, yens, pounds, etc.

    Drew 

    J. Drew Allen
    The Children's Hospital of Philadelphia
  • 07-31-2008 2:26 PM In reply to

    • William Da Silva
    • Top 500 Contributor
    • Posts 36
    • Organization: Centraide Québec
    • Products:  The Financial Edge, The Raiser's Edge

    Re: Summarize on RE field Currency_amount

    For now, I am sumarizing on this function.... (basic syntax)

    Dim Result as String
    Result = {Gf.Gf_Currency_Amount}
    IF InStr (1, Result, ".") > 1 THEN   
        Result = Replace(Result,",","")
    END IF

    Formula = ToNumber(Replace(Replace(Replace(Replace(Replace(Result,"$",""),"£",""),"¥",""),"€","")," ",""))

     

    William da Silva
    eSimpleIT.com
  • 07-31-2008 2:47 PM In reply to

    • Drew Allen
    • Top 10 Contributor
    • Posts 514
    • Organization: Children's Hospital of Philadelphia
    • Products:  The Information Edge, The Raiser's Edge

    Re: Summarize on RE field Currency_amount

    I can see why you might want to summarize for each currency, but I don't see why you would want to sum a mix of currencies together.

    Drew
     

    J. Drew Allen
    The Children's Hospital of Philadelphia
  • 07-31-2008 4:03 PM In reply to

    • William Da Silva
    • Top 500 Contributor
    • Posts 36
    • Organization: Centraide Québec
    • Products:  The Financial Edge, The Raiser's Edge

    Re: Summarize on RE field Currency_amount

    Hi Drew,

    You are correct. I am not adding different currencies together. I do however want to sum up amounts for each currency seperately, but they all appear on the same report.

    Example, my report could look like

    CAD = 10 000

    USD = 10 000

    EUR = 10 000

    ...

    Each 10 000 of what ever can be comprised of many different gifts. RE exports the amounts with the proper currency symbols and "punctuation". Crystal is unable to recognize these as numbers and can not sum on it.

    Thanks,

    William

    William da Silva
    eSimpleIT.com
  • 07-31-2008 4:03 PM In reply to

    • William Da Silva
    • Top 500 Contributor
    • Posts 36
    • Organization: Centraide Québec
    • Products:  The Financial Edge, The Raiser's Edge

    Re: Summarize on RE field Currency_amount

    Hi Drew,

     Ccur did not work.

    Thanks,

    William

    William da Silva
    eSimpleIT.com
  • 07-31-2008 4:18 PM In reply to

    • William Da Silva
    • Top 500 Contributor
    • Posts 36
    • Organization: Centraide Québec
    • Products:  The Financial Edge, The Raiser's Edge

    Re: Summarize on RE field Currency_amount

    Changed my function to Crystal Syntax. I thought it was giving me an error when running through RE.

    I also added a replace to deal with "," as a decimal separator.

    StringVar Result := {Gf.Gf_Currency_Amount};

    IF InStr (1, Result, ".") > 1 THEN   
        (

        Result := Replace(Result,",","")
        )
    ELSE
        (
        Result := Replace(Result,",",".")
        );

    ToNumber(Replace(Replace(Replace(Replace(Replace(Result,"$",""),"£",""),"¥",""),"€","")," ",""))

     

    William da Silva
    eSimpleIT.com
Page 1 of 1 (7 items)