Use of variables in cross tab

Hi experts,
Can anyone tell me how to use a variable in cross-tab?
I am populating the crosstab from the columns of a table.
I want to use a variable (say percentage of averages) which calculates for each month for any number of months the data has been generated.
Ex: Demo is my table and contains two average fields - average1 and average2 generated once for each month.
Now I want a variable which calcaulates for each month, their variance based on some formula like (average1-average2)/average1.
I have created a variable which calculates according to the above formula but its value is getting repeated for each month (the value of the first month) . It is not giving me the value corresponding to each month.
Request you to help me.
Thanks,
Roshan

Hi,
Thanks for the reply.
I have the following data from the cross tab.
     Jan     Feb     March
Average 1     25     35     50
Average 2     20     20     35
Average 3     15     10     25
And i want to generate the following structure dynammically based on the number of months/quarters.
     Jan     Var %     Feb     Var %     March     Var %
Average 1     25          35          50     
Average 2     20     20     20     42.85     35     30
Average 3     15     40     10     71.42     25     50
The new columns in the crosstab display should be dynamically generated.
Request you to help me generate the new columns and the values.
I have created this table in MS-Excel for reference.
Thanks,
Roshan

Similar Messages

  • Using a variable in refreshing tab

    Hi all,
    i want to use the following query in the refreshing tab of a variable
    select count(*) from Scott.abc where scott.abc.filename=#filename
    where #filename is a declare variable that contains the name of a file(text) .
    But when i execute this variable, it is giving invalid sql format.
    So can i use a variable in the refreshing tab of a variable??? if so.. how??
    Or if not then how do i compare the value of a column of a database table with the value stored in an odi variable.
    Kindly help.
    Thanks in advance.

    Easy method to debug such issue is to copy your SQL [ select count(*) from Scott.abc where scott.abc.filename=#filename ] into any SQL Editor.
    Secondly copy the value of the #filename from the History tab of the variable from the Operator and substitute in the above query and run that should give you a more clear idea .
    It would not only help in this issue too but other issues when you are fetching values from variable or query .
    hope this helps.

  • How to use php variable for default tabbed panel

    I have a tabbed panel and with tabs labelled with the days of the week.  What I want to do is open up the tab that correspond to the current day.  I have been using the following to get the day in 3 char format:
    <?php
    $jd=cal_to_jd(CAL_GREGORIAN,date("m"),date("d"),date("Y"));
    echo(jddayofweek($jd,2));
    ?>
    What I want to do is replace the value for the default tab in the following statement with a variable that matches the day returned with a number:
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1", {defaultTab:1});
    Please could anyone advice?
    Regards,
    Lloyd

    Hi,
    BIND_VARIABLE is useful when you have only IN variable but in your case you have IN and OUT.
    I don't know if you use the gateway for MS SQL SERVER or HSODBC/DG4ODBC but here how you can do to call a remote procedure with bind variables:
    DECLARE
    ret integer;
    inp varchar2(255);
    outp varchar2(255);
    BEGIN
    inp :='Hello World';
    outp :='';
    ret := "dbo"."in_out_proc_test"@tg4msql( inp, outp);
    dbms_output.put_line('Input value: ' ||v_ut1||' - Output value: '||v_ut2);
    END;
    The MS SQL Server procedure belongs to the user "dbo" and the database link
    being used is tg4msql.
    The following line initilaize the out variables of the procedure with an
    empty string:
    outp :=''
    I hope it helps you.
    Regards
    Mireille

  • Using Embedded Summary in Cross-tab Report in Crystal

    Hi,
    I am trying to use embedded summary to calculate % Increment by fiscal period (in column) for specific sales areas (in rows). I need some help in identifying the formula which I can use to do so. If someone has experience of using embedded summary or any other method to achieve this please let me know or site me an example on how i can achieve it.
    Thanks in Advance.
    Regards
    Varun

    Good job!  Thanks for posting the solution.
    But, I'm wondering why you are using a FOR loop.  Crystal Syntax is not my strength (I use Basic Syntax), so I could be reading this wrong, but your formula seems equivalent to
    GridValueAt (CurrentRowIndex,CurrentColumnIndex , 0 ) - GridValueAt (CurrentRowIndex, 1, 0);
    HTH,
    Carl

  • How do I use a Cross-Tab to show me multiple fields without Summaries?

    Post Author: lindad
    CA Forum: Charts and Graphs
    Is it possible to add a Cross-Tab to a report with 6 columns and 4 rows; the values in each field are taken from a different field in the db and no summaries are used?
    Essentially the cross-tab needs to look like a table that you would create in Excel or Word.

    Post Author: Manuel de Kleine
    CA Forum: Charts and Graphs
    Linda,You cannot do that, because cross-tabs have always a summary on the axes (the number of having the value in the column AND the value in the row).If you need a table, you can use borders for your field and field header.

  • Cross-tab Report field representation

    I need to display a field (Abandon Rate) in my cross-tab report - Abandon Rate is not a field in the database.  The field is a result of a formula:
    100*(AbnCalls/InCalls)
    How do I go about doing this?  I've tried to type the formula into the Display String but get an error "The Formula result must be a string".

    The only way Display String will work here is if the two variables in your formula are Global variables.  In that case, just add CStr to your formula to turn it into a string:
    CStr(100*(AbnCalls/InCalls), "0.00")
    If the two variables are from the database, create a formula field and use that in the cross tab.
    HTH,
    Carl

  • DS Cross tab dynamic measure

    Hi,
    Like in Webi can we create a variable in Design studio with calculated measures and this can inserted in cross tab to pull the values dynamically.
    I have seen the document that global and local variables are created and used in Text button to display, this works fine for me too.
    The same measure can we use to insert in cross tab to pull the values dynamically...like. .Actual Sales is a measure
                                             Jan                feb              march      Total Sales(3months Actual Jan feb March+9 Month forecasted sales data)
    Region                                           
    Europe                              50                  60                   70           ----
    North America                   30                  52                   75          ------
    Asia                                   85                  15                   65           --------
    I would like to know total sales can be calculated using the above logic  in Design studio level and will this pull the data when you drop in the cross tab.
    Thanks,
    Ramesh.

    Hi Tammy,
    I just want to know the do's and don't in DS,  As you said in bex its very easy to pull out.
    Thanks,
    Ramesh.

  • Rows limit in Cross Tab

    I receive this message "The numbers of rows or columns exceeds its limit,65535" although it reads more 100,000 records but does not shows
    Can anybody help please.
    Regds
    Basil

    Hi Basil
    Cross tabs have a limitation on the amount of rows and/or columns that can be displayed within the cross tab object. This limitation is 65,535. 
    To work around this limitation, use grouping within the cross tab to limit the amount of rows/columns displayed.
    Regards
    Girish Bhosale

  • # Multivalue error in cross tab

    Hi All,
    I am using BO-launch pad 4.1,sp2 Data is from Bex-query using CMC.
    Table: Cross tab
    1)Dimenssion obj: CO-object
    2)Attributs: Co-obj-wbs elemt,costcentr,order
    3)Measure:Budjet aproval overall, Budjet for annul,Actual cost, Actual quantity,planned cost, planned quantity
    when drag i dimension co-obj,attributes and all measures it showing values but when i drag attributes and measures (No need to drag dimension) it is showing in crosstab
    # Multivalues error in all measure fields.
    Can you plz give me suggestions on this.
    Thanks
    Ganesh

    Hello,
    Please check if you have used exception aggregation on measures in the BEx queries. These aggregation might be using some dimensions as reference characteristics. And if that dimensions are not included, you might get these multivalue error.
    Good Day !!

  • Data binding cross tab in Crystal 2008 with Xcelsius swf file

    I've created a visualisation in Xcelsius and want to bind it to a cross tab in CR2008.   The labels appear correctly in the swf visualisation but I get no data.   The format of the table in Xcelsius and the cross tab I believe to be the same, covering data formats.   I have placed the Xcelsius visualisation in page header "a" with the cross tab in page header "b".   The Xcelsius table has been defined in terms of column and row headers as well as data area, so I've done everything that I understand to be correct.   In CR2008 I have specified that I use the existing named cross tab.
    Does anyone have any idea what I may have missed.
    tia
    Neil

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly

  • Substitution Variable in Cross Referencing dimensions

    Hi All,
    Can we use substitution variable for cross referencing dimensions.
    Example:
    "Region" = &currmth->&curryear->"New York";
    Thanks in Advance
    Bal.

    Hi John,
    If I use substition variable the answer/value for 'DOM' comes vague. If I hardcode the variables, the values for 'DOM' it comes perfect/accurate.
    Can you please help sir ?
    The Calc script is (Hardcoded value are Sep, FY09,Budget)
    //ESS_LOCALE English_UnitedStates.Latin1@Binary
    SET CACHE HIGH;
    SET LOCKBLOCK HIGH;
    SET AGGMISSG OFF;
    SET UPDATECALC ON;
    SET CREATEBLOCKONEQ ON;
    /* Material Expenses Allocation */
    FIX(&xscenario,&xyear,&xmonth,"NoLocation","NoModel",&xversion,@LEVMBRS("KD PARTS TOTAL",0),@LEVMBRS("VEHICLES",0))
    "DOM" = ("Sep"->"FY09"->"Budget"->"NoRegion"->"InputVersion") * ("Indigenous component cost-Domestic-%"->"REGION"->"ENTITY"->"Budget"->"Sep"->"LOCATION"->"MODEL"->"FY09"->"InputVersion")/100;
    ENDFIX
    Many Many thanks in advance.
    Bal

  • Creating a Cross tab that contains fields with shared variables

    I am trying to create a cross tab in CR2008. I can get the field in the details but cannot choose it when trying to create a cross tab. Please help.
    Thanks.
    Shared numbervar MonHrs;
    Shared numbervar TueHrs;
    Shared numbervar WedHrs;
    Shared numbervar ThuHrs;
    Shared numbervar FriHrs;
    Shared numbervar SatHrs;
    Shared numbervar SunHrs;
    If dayofweek(today) = 1
        then {@CapacityTeamCount} * SunHrs else
    if dayofweek(today) = 2
        then {@CapacityTeamCount} * MonHrs  else
    if dayofweek(today) = 3
        then {@CapacityTeamCount} * TueHrs else
    if dayofweek(today) = 4 
        then {@CapacityTeamCount} * WedHrs else
    if dayofweek(today) = 5
        then {@CapacityTeamCount} * ThuHrs else
    If dayofweek(today) = 6
        then {@CapacityTeamCount} * FriHrs else
    if dayofweek(today) = 7
        then {@CapacityTeamCount} * SatHrs

    I don't use CR cross tabs as a matter of preference so I can't tell you if the shared variables are having an impact on their availability in the cross tab dialog or how to make the necessary adjustments...
    I can, however, tell you that you don't need a cross tab for what you are trying to do. All you need to do is split all of the IF formulas in to their own formulas.
    This will place each day in it's own column.
    Now... you'll notice that there's a lot white space and nothing's aggregated... Not to worry, it's easy to fix.
    Just create a grouping on which ever field you were going to use as "rows" in the cross tab... insert SUM totals in the group header... and hide the details.
    Now you have created your own manual cross tab, without using CR's cross tab object.
    HTH,
    Jason

  • Pass a shared variable from a sub-report into cross-tab

    Hello everyone!
    I need to pass a calculated value in a shared variable from a sub-report into a croos-tab in the Group footer of the main report. When I place this variable in the group footer I can see the value, when I use this variable in the Cross-tab, it is 0.
    In the Sub Report:
    whileprintingrecords;
    shared numberVar Total_SF;
    Total_SF:= calculation.
    In the Main report:
    whileprintingrecords;
    shared numberVar Total_SF;
    In the Cross-Tab I am using the above formula from the main report.
    Do you guys know what I need to do for this to work?
    Thank you,
    T.

    Hey Tat,
    I have learned to avoid passing shared variable from sub reports back to main reports.  You just always seem to run into issues with execution order.
    Personally, I try to create a shell report and add sub reports, calculating the values I need in the first sub report and pass the values to subsequent sub reports using shared variables.  I'd recommend thinking about arranging your reports like this during your design time.  It has saved me some headaches.

  • Array in formula to use in a cross-tab

    Post Author: eliasc
    CA Forum: Formula
    I am using CR 10.  I have a report where I am using a formula to use as a column header for a cross-tab.  Below is an example of what I am trying to achieve.
    ATLANTA INVOICE  ATLANTA SERVICE  ATLANTA WARR.  BIRMINGHAM INVOICE BIRMINGHAM SERVICE BIRMINGHAM WARR.  ETC..
    Below is the array in my formula.
    Shared NumberVar i;Shared StringVar CompanyName;Shared StringVar Array Companies := &#91;"HFSE - FW","ATLANTA INVOICE","ATLANTA SERVICE","ATLANTA WARR.","BIRMINGHAM INVOICE","BIRMINGHAM SERVICE","BIRMINGHAM WARR.","BGSI INVOICE","BGSI SERVICE","BGSI WARR.","PEN INVOICE","PEN SERVICE","PEN WARR.","JACKSON INVOICE","JACKSON SERVICE","JACKSON WARR.","FORT WORTH INVOICE","FORT WORTH SERVICE","FORT WORTH WARR.","JAX INVOICE","JAX SERVICE","JAX WARR.","LOUISVILLE INVOICE","LOUSIVILLE SERVICE","LOUISVILLE WARR.","OKLAHOMA CITY INVOICE","OKLAHOMA CITY SERVICE","OKLAHOMA CITY WARR."&#93;;0;
    local stringvar tString;shared numbervar CompName;
    CompName :=UBound(Companies) +1;i := CompName;
    For i := 1 to CompName step 1 do(  ReDim Preserve Companies&#91;i&#93;;    tString :=Companies&#91;i&#93; );
    tString;
    Can someone please help me.  I don't know where I am going wrong and why it isn't putting the above names in the cross-tab columns.
    Thank you for your help.
    Chris

    Hi,
    The "buffer" variable in DIG_Block_Out is an array of short integers (16 bit integers). It expects you to pass the array pointer as the function value. In the example below, "buffer" would be the parameter value.
    Dim buffer(5) as Integer
    Ron

  • Is there a limit to no. of summary fields that can be used in a cross tab?

    Hi,
    While creating a cross tab is there a limitation to number of summarized fields that can be used?
    - The cross tab when uses 184 fields as summary fields leads to Crystal report application to crash at the time of export to excel.
    - Tried with two Datasources: XML and excel
    - If we reduce the number of summary fields used to 102 exactly, export works fine in excel.
    - If 2 cross tabs are used each containing 92 summary fields(in order to show 184) export to excel works fine.
    Please let me know if there is any such limitation which leads to CR application to crash when exporting in excel?
    Thanks
    Regards,
    Nidhi

    I suggest you purchase a case and have a dedicated support engineer work with you directly:
    http://www.sdn.sap.com/irj/boc/gettingstarted
    Or
    http://store.businessobjects.com/store/bobjects/Content/pbPage.CSC_map_countyselector/pgm.67024400?resid=jFmmLgoBAlcAAALO-iYAAAAP&rests=1278687224728
    If this is a bug you'll get a refund, if not post your enhancement request in the Idea Place. Or the Rep will suggest a better way to create your report.

Maybe you are looking for