Custom formula in cross-tab?

I have a cross-tab like this
                  JAN    FEB    MAR ....... DEC (the 12 months as columns)
year 2006
   item 01     150    205      300 .......    550
   item 02       80    190      284 ........   620
year 2007
   item 01      458    235      224 .......... 781
   item 02      154    254      134..........  254  
year 2008
   item 01       245    154      544           1243
   item 02       524    254      124 .........   924     
I want to know if is possible to have a formula that take the value of each month and compare with the previous and make a calcule like this...
                  JAN    FEB    MAR ....... DEC (the 12 months as columns)
year 2006
   item 01     150    205      300 .......    550
   item 02       80    190      284 ........   620
year 2007
   item 01      458    235      224 .......... 781
                   (205)   (14)
   item 02      154    254      134..........  254  
year 2008
   item 01       245    154      544           1243
   item 02       524    254      124 .........   924 
where (205) and   (14) are calculate from:
(205) = (150 - 458) * 100 / 150 I have to  make this operation for each month takin the values from item 01 from 2006 with the values from item 01 from 2007 and so on
Edited by: j jara on Jul 22, 2008 2:01 AM

Yes it is possible.
It would be easier in CR2008  where you have the ability to add Calculated Members.
In previous versions you would need to create a variable for each year and using the GridRowColumnValue function assign the current value to a variable. You would then need to add a second summary field as a "dummy" summary and in the Display string formula declare the variables and manipulate the values as you like and finally convert the output to string.

Similar Messages

  • SAP Crystal Report - Formula in Cross Tab Report

    I have a below requirement in a cross tab report,
    Category          Name          Valu1          Value2    %ge
    A                       Car               40                  50        80
    A                        Bike             30                  60        50
    Total                                       70               110     63.6
    %ge is a formula field and is calculated as value1/value2 * 100
    Consider the Total section as a group footer.
    In the cross tab report how do I put the formula field for %ge in Total section.

    Vishujain
    Crosstabs are very structured and you are limited in what you can do with them. You can do a percentage summary in Crosstabs, but only as a percentage of the row total or the percentage of the column total. You cannot put a formula in the crosstab to do a percentage of a values in seperate rows. Any time I need to perform a function not available in a crosstab, I do a manual cross tab. Look at: [Manual Crosstab Explaination|Re: Formulas : Help for coding]
    Debi
    Edited by: Debi Herbert on Nov 3, 2011 11:51 AM

  • Running Totals and Formulas with Cross Tabs

    Hi,
    I'm using Crystal Reports 2008 and am having two issues using Cross Tabs.
    The first is that I want to have two crosstabs. They both will have a common Y axis (Oppourtunity.Sales Rep), and on the Y Axis I want one to show all (Opportunity.Create Date) where (Opportunity.Staus = Won) and the other where (Opportunity.Staus = In Process), but I can't figure out how to contruct the formula to return this result.
    The other issue, is that in addition to summarizing based on Sum (Opportunity.Expected Revenue), I would also like to create a running total to show the cumulative (Expected Revenue) Week over Week.
    Any direction would be fantastic.
    Thank you,
    Michael

    Please go through the SAP Notes listed here which would help you how to create mannual running totals in crosstab
    [https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_ossnotes&query=runningtotalin+crosstab&adv=true&note_number=&component=&sdn_updated_on_comparator=GE&sdn_updated_on=&sortby=cm_rnd_rankvalue]
    Regards,
    Raghavendra

  • Diffrent Data Type & Formula in Cross Tab

    Post Author: ade
    CA Forum: General
    I using crystal reports 8.5. I make cross tab like this to viewing reportsSubject           Evaluation Aspect                          Score1        Score2            Score3        Score4        Score5 Math               Conceptual Understanding                     80                    75                     70                 80                   A                          Problem Solving                                          77                    80                            90                67                    BEnglish                Reading                                                        89                    80                             86                80                    A                                Wring                                                        80                        80                              70                85                  Bfrom the table above, there are 2 types of different data they are numeric and string.In the using of logical "if" in cross tab is not allowed to use different data type and I don't understand on it... would you please help me, what shoul I do then? 

    Yes it is possible.
    It would be easier in CR2008  where you have the ability to add Calculated Members.
    In previous versions you would need to create a variable for each year and using the GridRowColumnValue function assign the current value to a variable. You would then need to add a second summary field as a "dummy" summary and in the Display string formula declare the variables and manipulate the values as you like and finally convert the output to string.

  • Formula/manual cross tab help

    my variable name in my database is rsq01. the results for this variable are 0,1,2,3,4,5.
    I need to setup a crosstab that only shows the results 1-5 and what percent of the total results they are, 0 needs to be excluded
    from the crosstab and from the count that is used in figuring the percentage because 0 is actually null.
    I have been told to do this I will have to make a manual cross tab using formulas.
    Any suggestions/examples on how to do this? Thanks.

    Pretty simple actually. Just create 5 formulas...
    //Formula 1
    Global NumberVar rsq01;
    IF rsq01= 1 THEN {TableName.FieldName} ELSE 0
    //Formula 2
    Global NumberVar rsq01;
    IF rsq01 = 2 THEN {TableName.FieldName} ELSE 0
    //Formula 3
    Global NumberVar rsq01;
    IF rsq01= 3 THEN {TableName.FieldName} ELSE 0
    //Formula 4
    Global NumberVar rsq01;
    IF rsq01= 4 THEN {TableName.FieldName} ELSE 0
    //Formula 5
    Global NumberVar rsq01;
    IF rsq01= 5 THEN {TableName.FieldName} ELSE 0
    Then group by the appropriate field, sum each of the formulas and hide the details.
    HTH,
    Jason

  • Formula for cross tab row

    Post Author: bvandyck
    CA Forum: Formula
    The results of a row in a cross tab report need to be split out by percentages and added to the results of other rows.  Each row is an individual, except one row is a combination of individuals.  Certain individuals share in the results of the combination row.   The combination row will be zero after being added to the individuals' rows.  What is the formula for achieving this?

    Hi,
    U may create a new formula for that.
    There is an option in cross tab expert for new formula.
    U may create a formula of your choice and then insert in report.
    Regards,
    Misra P.

  • Customized Sort for Cross-Tab Row

    I have a simple Cross-Tab on my report that needs to be sorted in a static Row order.
    My cross tab has 1 Row (Name) and 1 column (Total Sales).
      Currently the CrossTab sorts the Name Alphabetically (ASC). But I need to specify a specific order.  I have added a numeric field to my table and I assign a numeric value to the last names so that I might be able to sort the Name Row based on my "CustomSortOrder" numeric field.
    Currently it looks something like this:
    A
    B
    C
    D
    E
    I want it to be: (numeric value behind the scenes)
    C (1)
    D (2)
    E (3)
    A (4)
    B (5)
    ALL OTHERS (9999)
    I cant seem to figure out where I need to set this.  I have tried adding a group to the report. I have tried setting the Report Sort order.  I am out of ideas.
    Any help would be greatly appreciated.

    Hi Jimmy,
    Here's what you need to do :
    1) Go to the Crosstab Expert > Remove the existing 'name' field from the 'Row'
    3) Add the numeric field as the 'Row'
    4) Select the Row > Group Options > Options Tab > Customize Group Name Field > Use formula as a Group Name > Click the formula button beside and use this code:
    If {numeric_field} = 9999 then "All Others"
    else
    {Name_Field}
    -Abhilash

  • Formula for Cross-Tab Column

    Hi
    I am struggling with a particular issue related to cross-tab and I tried a lot, but couldn't managed to get the solution.
    Please help with this issue , it would be of great help to me.
    Thanks
    Aniket
    [CrossTab problem|http://www.forumtopics.com/busobj/viewtopic.php?t=120765]

    Thanks for your prompt reply.
    As I am new to this forum,so I don't know how to attach file, also I tried searching but couldn't get.
    At the end of the previous post, Link is given. There is a file attached "Plz_help.zip". Please look into that file and also if you know how to attach any file, please let me know.
    If still it's not clear, please let me know I will try my best to clear this issue.
    [http://www.forumtopics.com/busobj/viewtopic.php?t=120765]
    Thanks a lot.
    Regards
    Aniket

  • 'print time' formula in cross tab?

    Is it possible to use a formula that is processed 'whileprintingrecords' in a cross table?

    Hi Marlene
    We cannot use the formula using Print time functions in Crosstab as these functions is processed in Pass # 2 of multi-pass reporting and the Crosstab is processed in Pass #1.
    You can refer Multi-Pass Reporting Topic of Crystal Reports Help for more clarification.
    To work around this issue you can use subreport and create a formula using print time functions and with the help of shared variable display it in Main report crosstab.
    Hope this helps!
    Thanks

  • Crystal Reports 2008 Formula in Cross-Tab Error Not Supported

    I have a crosstab that was created in Crystal XI and when I opened the report in Crystal 2008 I receive an Error "Not Supported" when I removed the fromula that was in the Crosstab the report displayed. The following is the formula that is within the crosstab:
    If {VWR_PPS_VISIT_SCHEDULE.COHORT_NAME} = '(No Cohort)'  THEN
        If DistinctCount({VWR_PPS_VISIT_SCHEDULE.COHORT_NAME},{VWR_PPS_VISIT_SCHEDULE.PROPOSAL_VERSION_ID}) >1 then
             {VWR_PPS_VISIT_SCHEDULE.COHORT_NAME}&" "&{VWR_PPS_VISIT_SCHEDULE.VISIT_NAME}
        else
            ""&" "&{VWR_PPS_VISIT_SCHEDULE.VISIT_NAME}
    else
        {VWR_PPS_VISIT_SCHEDULE.COHORT_NAME}&" "&{VWR_PPS_VISIT_SCHEDULE.VISIT_NAME}
    As I mentioned the formula works perfectly in Crystal XI but not Crystal 2008 which no sese at all.  We are preparing to migrate from Crystal XI to Crystal 2008 and if this is an issue we may need to but upgrading off.
    Any help with this would be gratly appreciated.
    Thanks
    Edited by: jackie2009 on Oct 9, 2009 3:41 PM

    Try adding brackets around the If statements.e.g.
    If {VWR_PPS_VISIT_SCHEDULE.COHORT_NAME} = '(No Cohort)' THEN
    If DistinctCount({VWR_PPS_VISIT_SCHEDULE.COHORT_NAME},{VWR_PPS_VISIT_SCHEDULE.PROPOSAL_VERSION_ID}) >1
    then {VWR_PPS_VISIT_SCHEDULE.COHORT_NAME}&" "&{VWR_PPS_VISIT_SCHEDULE.VISIT_NAME}
    else ""&" "&{VWR_PPS_VISIT_SCHEDULE.VISIT_NAME}
    else {VWR_PPS_VISIT_SCHEDULE.COHORT_NAME}&" "&{VWR_PPS_VISIT_SCHEDULE.VISIT_NAME}

  • Cross Tab calculation in Individual column-Crystal Report

    Hi experts
    I am preparing a report in Crystal report 2008. Report template is Cross Tab.
    Structure of report is
    Cardname-Row, DocType-Columnd, DocTotal-Summarize field.
    Result of this report is
                          IN(Invoice)             RC(Incoming Payment)      Total
    XYZ                    1000                  -500                                 500
    ABC                    2000                 -1000                               1000
    Total                   3000                  -1500                               1500
    I have inserted a column using calculated member. I want to Calculate in that column with BP opening balance
    eg. OCRD.Balance-DocTotal when I do this it give first value to all column rows, i.e (consider XYZ opng Balance is 1500, I have calculate month opening balance which meance Current Opening Balance-Current month Order bookings=Month opening balance)
              IN(Invoice)             RC(Inc Pmt)      Total   Opng Balance
    XYZ       1000                  -500                  500     500
    ABC      2000                 -1000                1000     500
    Total      3000                  -1500                1500    500
    I want to calculate Opng Balance for each CardName but it gives first Customers opning balance to all customers.
    Give me solution.
    Thanks in Advance

    Hi
    I think you can do calculation based on the formula .On the cross tab ,there is :
    X -selection - row
    Y - selection -column
    Z - summary
    You can also use formula on cross tab to do that function  and insert into summary section .
    Hope this helps .
    Bishal

  • Cross-tab row header

    i use the display string conditional formula on cross-tab row header. but it ends up every row has the same value.
    how can i solve this? is that possible to do it in crystal report?
    thanks,

    Hi,
    could you please make it more clear what exactly u want to display and what is the problem that u r facing in doing the same.
    Regards,
    Misra p.

  • Cross tab formula help

    Post Author: ivanl
    CA Forum: Formula
    Hi,
    Using XI and win XP.
    I have been using excel to get the info I need, but thought it must be possible to do it right in the cross tab.  I need two different cross tabs, and do not know how to do the following.
    The fields I have in the dataset include:
    - product.type (different products and one field "product.type = 'customer' that is the customers)
    - product.balance (balance of each product for each customer)
    - formula for age segmentation
    What I need to input into the cross tab is to have the segmentation across the top, products for the rows and as the summary:
    1) penetration rate  (i.e. count of product types divided by # of customers which is product.type = customer)
    2) $ per customer (product balance divided by customers)
    3) $ per product (product balance divided by # of products)
    Help would be awesome.  I have no idea how to do this in Crystal
    To date, I have set up a cross tab with segment across top, products down the rows, and as a summary using count products and sum of balances.  I would input this into excel and do the calculations.
    Ivan

    Hi, this may help,
    http://www.chelseatech.co.nz/pubs.htm
    Look down on the right side, you should see
    Sample Report Files
    Sales Calendar
    Calendar Report
    Running Totals in a Crosstab
    Wrapping Crosstab
    PDF Drill Down
    Crosstab calculations
    Hierarchical Summary in a formula
    You can download an example of Crosstab Calulations from this site.
    They have some newsletters that also contain CR hints.

  • Bug – CR 2011 cross tab number decimal formula not executing

    I have a formula to format the number of decimal points in both the column and row header values in a cross tab subreport. The formula does not appear to execute.  If I display the data in a simple table format and use the same decimal formula the format is correct.
    cross tab header, decimals not displayed correctly
    Data when displayed in a simple table using the same formula, decimals are displayed correctly

    Hi Paul,
    Here's another way:
    Remove the formula you've used under 'Decimal' for the cells in the crosstab.
    Right-click one of the cells > Format Field > Common tab > Click the formula button beside 'Display String' and use this code:
    numbervar x := CurrentFieldValue;
    numbervar ipart; 
    numbervar decpart; 
    ipart := int(x) ; 
    decpart := x - ipart;
    if ipart > 0 then
    totext(ipart,0)
    else if decpart > 0 then
    Replace(totext(decpart),"0","")
    -Abhilash

  • Error in executing Formula Fields in "Calulated Member" of Cross Tab?

    Hi Experts,
         I am not be able to exeucte formula "totext(towords(tonumber(totext({Comp_Prod.Cost},2,"")),2))" in "Calculated Member" of Cross-Tab.
         Plz help me on this.
    Thanks in Advance,
    Rishit

    Hi vinay,
    Thanks yar, i got my soln.
    One more thing is, this words are inserting in same column of total.
    If i want to display 1) Figure and 2) It's equivalent word, then can i do it?
    i.e. first it displays total and then it displays it's equivalent word.
    Thanks again,
    Rishit
    Edited by: Rishit Kamdar on Apr 7, 2009 3:06 PM

Maybe you are looking for