Calculated members in cross tab
Hi all,
I have a profit and losses in a cross tab created by a group and I need to add some rows to have the totals.
For example
Revenue 1
Revenue 2
Revenue 3
Total Revenue
Cost 1
Cost 2
Total Costs
For total revenue I used a calculated members with that formula:
GridValueAt(GetRowPathIndexOf("Revenue 1"), CurrentColumnIndex, CurrentSummaryIndex)
+ GridValueAt(GetRowPathIndexOf("Revenue 2"), CurrentColumnIndex, CurrentSummaryIndex)
+ GridValueAt(GetRowPathIndexOf("Revenue 3"), CurrentColumnIndex, CurrentSummaryIndex)
but the problem is that if I haven't for example any data for revenue 2 an error occurs -->argument # 1of "gridvalueat" is out of range.
It's possible to check if the argument exist??
thanks
hi alessandro,
i just found your forum post in the unanswered list...hopefully you've already found the answer for this.
GetRowPathIndexOf is looking for the text in a specific cell and not the actuall Row or Column Name.
When it doesn't find it, its output is -1...so you can use that in your formula to ensure that it doesn't break.
for example, if you have a cross-tab that looks like
Canada 1006
USA 5555
Mexico 2331
GetRowPathIndexOf("Mexico") = 2 (as the index starts at 0 for Canada)
GetRowPathIndexOf("Brazil") = -1
hope this helps,
jamie
Similar Messages
-
CR 2011 - calculated member in cross tab
Hello,
I have created a cross tab in my report and added a calculated member. I have created a formula for all my rows because by default the value of the calculated member was "0". Now I wanted to add a new row to my report. The value in the calculated member now is not "0" but empty. How can I access the formula workshop now?
Can anybody help?
Thanks and regards,
Juleif you right click on the cross-tab > go to Advanced Calculations > Calculated Member > click on the one that you want to edit and press the Edit Value Formula button
cheers,
jamie -
Formatting Calculated values in Cross Tab
I have a P & L Style cross tab where I have inserted calculated values to calcuate the key % values (Turnover, Overheads etc).
I have used the "Quotient" calculations & bet the correct data, but I would like to format the values to show as %> When I try to change these values, all the values show as %.
Is there any way to achieve what I need?
ThanksThanks for that, it would have been easier than the way I found, which was using the display string in the field formatting.
I might have another pass at it now.
Much appreciated -
SORTING FOR THE CALCULATION FIELD IN CROSS TAB REPORT
LIST_G_AUCTION_TITLE>
<G_AUCTION_TITLE>
<BID_NUMBER>5002</BID_NUMBER>
<AUCTION_TITLE>E2E-01 Construction RFQ</AUCTION_TITLE>
<ITEM_NUMBER>C2631</ITEM_NUMBER>
<ITEM_DESCRIPTION>4G000,000,0STRUC,X,SPECIAL STRUCTURE</ITEM_DESCRIPTION>
<ESTIMATED_QTY>1</ESTIMATED_QTY>
<UNIT>LS</UNIT>
<QUOTE_PRICE>400</QUOTE_PRICE>
<ESTIMATED_QUOTE_PRICE>400</ESTIMATED_QUOTE_PRICE>
<SUPPLIER>X - L CONTRACTING</SUPPLIER>
my xml data is in this format, i created a cross tab report for ITEM_DESCRIPTION as row and SUPPLIER as column and calculated a sum(ESTIMATED_QUOTE_PRICE)
for all the ITEM_DESCRIPTION for every SUPPLIER in templete . now i need to sort the data by sum(ESTIMATED_QUOTE_PRICE) from lowest to higest from left to right , that is supplier with lowest sum(ESTIMATED_QUOTE_PRICE) should display first from left to right.
can any one help thanks in advance.thank you tim , for asking i got the solution. it is actually in template builder i was asking about. xml template builder
-
Calculating values on cross-tab
Post Author: Reisp
CA Forum: Charts and Graphs
Is it possible to calculate values in a cross-tab , for example , create a column3 = column1 + Column2 ?Hi,
try to cerate a new calc :
nvl(status_cnt,0)
and create the totals on it,
I think you got nulls in that column so it wont aggregate properly. -
Hi,
I have multiple crosstabs reports in a single tab each running on a different query.
1st cross tab
I created a crosstab report which has Account names,in the left column, dates in the top row header and account data in the data cell. This reports runs for historical dates example 01/2008-10/2008.
I have caculated the average for this report and named it hist avg.
months
acct names data for each month hist avg
2nd cross tab
I am using a different query which has account names and a single value(Field Value) for each account name. eg acct names Field Value Field Value* Hist Avg (Caculated)= target histavg(forsort)
Acct 1 3
Acct 2 29
3rd cross tab
I created a crosstab report which has Account names,in the left column, dates in the top row header and account data in the data cell. This reports runs for current dates dates example 01/2009-04/2009.
I have caculated the average for this report and named it Current Avg.
months
acct names data for each month curent avg Hist avg for sort target
ISSUE :
I need to put alerters on 3rd cross tab based on target calculated in 2nd cross tab.
All 3 cross tabs are mergered on acct names. and sorted according to desc hist avg
But when I put alerters it is not working. Cross tab 1 and 3 has same query but different date prompts.
I tried merging date dimensions. Now wht I have got is both cross tab displays histavg dates+ Current dates but data for only hist dates or current dates. I used hide empty coloums, So it doesn't show emplty coloums. and was able to bring hist avg in 3rd cross tab.
BUT ALERTERS ARE NOT WORKING.
Field value is a standalone derived table.
Is there are way to use alerters on acct data from one cross tab into anothers when both are running on different dates.????
Thank you in advanceLook at the Total Wizard. You should be able select the right options to have totals at different level of the data. Also give us an example what you want to achieve.
-
How to Suppres a Row in Cross Tab?
Hello All
I have a cross tab where I wish only to show the result of the calculation.
The cross tab is like this
Header............Period
Sales..............X
Costs..............Y
Cost/Sales.......Y/X
What I want to show is the result only Cost/Sales
Header............Period
Cost/Sales.......Y/X
Hiding the Cells Sales and Costs but still using their results in the calculation.
Is there anyway to do this? As at present I can only supress Sales and Costs and minimize their size but this looks silly as you get a result like
Header............Period
Cost/Sales.......Y/X
With Space in between.
Any help would be appreciated.
Thanks
Phillipcross tab functionality is different than a regular report, you cant always do what you want surpression wise...
if you just want to show a summary i would create a standard report
and surpress what you dont want and just show your summaries. -
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,
RishitHi 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 -
Cross-Tab - conditional suppression and formatting
I have a cross-tab report of "widgets" sold. There are $10 widgets, $20 widgets, and $50 widgets. All widgets will always cost some round dollar amount, never anything like $10.99. My report shows weekly, month-to-date, and year-to-date sales for each widget denomination by both count and total amount by state. For example:
$10 $20 $50
count amount count amount count amount
New York
Week 5 $50 4 $80 1 $50
MTD
YTD
Delaware 1 $10
etc.
I also have totals by row, along with mark-up amounts (11% of gross sales amounts) and net sales (gross - mark-up). These last 3 columns are included in my dataset, not calculated in the cross-tab.
My problem is that I can't figure out how to do 2 things:
1. the count columns for mark-up and net will always be blank, so I want to suppress the "count" column header
2. I want to display the dollar amounts for those 2 columns with 2 decimal places, but the other amounts with no decimals.
Can this be done, and if so, how?
Thanks!
PhilHi Phil,
I also found the following information under Cross-tab Help for suppressing rows or columns. I hope this is what you're looking for. Sylvie
To suppress empty rows and columns
Right-click the blank top-left area of the Cross-Tab and select Cross-Tab Expert from the shortcut menu.
The Cross-Tab Expert appears.
Click the Customize Style tab.
Select either the Suppress Empty Rows or Suppress Empty Columns check box.
Click OK.
Now, when you print the report, empty rows and/or columns will not appear.
To suppress row and column grand totals
Right-click the blank top-left area of the Cross-Tab and select Cross-Tab Expert from the shortcut menu.
The Cross-Tab Expert appears.
Click the Customize Style tab.
Select either the Suppress Row Grand Totals or Suppress Column Grand Totals check boxes.
Click OK.
To suppress subtotals and their labels
If you have more than two groups in your Cross-Tab you can suppress the subtotal and label for one of them.
Right-click the blank top-left area of the Cross-Tab and select Cross-Tab Expert from the shortcut menu.
The Cross-Tab Expert appears.
Click the Customize Style tab.
Click the field whose subtotal you want to suppress.
The Suppress Subtotal and the Suppress Label check boxes become active.
In the Group Options area, select the Suppress Subtotal check box.
Click the Suppress Label check box to suppress the label associated with subtotal.
Click OK. -
Format Fields in Cross Tab and Calculated Members
Hello:
I have a cross Tab with a calculated member, I need to display one decimal or no decimal in some of the columns so I created a formula in the Display String option like this:
if GridRowColumnValue ("@TestID_desc")= "ALK mg/L
then
Cstr(CurrentFieldValue, "0")
else
Cstr(CurrentFieldValue, "0.0")
But, after I saved the formula the value in the calculated member colums disappears. Any ideas? Thank You in advance!right click on calculated field and go to format field and in number tab select customize button and write the condition for decimals.
regards,
Raghavendra -
Calculated Members in a Cross Tab
I have a Cross Tab report with Year as the Column Headers and Product Name as the Row Headers with Sales as the Summarized Field. There are 5 Year values (e.g. 2004 to 2009 Inclusive) and I have created 5 new Calculated Member columns that do comparisons between consecutive years. Everything works fine.
However, the report is parameter driven for the Year range and if I choose a new range (e.g. 2000 to 2004) different than my current range (e.g. 2004 to 2009) this causes all my Calcuated Member columns to disappear.
Is there a way to keep the 5 Calculated Member columns I created whenever I change the range of Years?
I do not want to resort to a Mock Cross Tab.
Any help would be appreciated. Thanks in advance.David,
If your parameter for the years were a starting year number, you could base all your calculations on it.
for example starting year=X
then data selected would be between Year(X) and Year(X)+4
And your column calcuations would be for years X, X1, X2, X3, X4
Debi -
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 AdvanceHi
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 -
Calculations based on Summarized data in Cross Tab
First off, I'm pretty experienced with Crystal.
I've run accross something that seems like it should be realy easy to do, and the sort of thing you would expect to do in a cross tab... so maybe I'm missing something totally obvious.
I'm doing a year over year comparison of some financial data broken down by month and by quarter.
So, my Rows are Quarter, and a field called 'YEARMONTH' (calculated field, YYYYMM, for ease of sorting)
My column is Year, and for summarized fields, I have the data field I'm interested in which is a float. Let's call it 'Dollars' for sake of argument.
What I want to do is create a summary field (next to the total field) called 'Difference' or 'Delta' that calculates for reach row the difference between my two years (2008, and 2009)
The only solution I can come up with is to dummy in a record from the datasource with a year value of 'Difference' and some other dummy values so that it will show up as a column on the cross tab, and then somehow use the currentrowcolum function or some such creature to mask the output in the column. but now that I type it out here, I'm not sure it's going to work. I also don't think it's going to export the way I want it to either.
I'd really prefer it to be in a cross tab, and not in some manually created cross-tab emulation using manual running totals, but I'll go there if I have to.
Thanks a ton!This is what I did in my report to get the difference
my crosstab looks like this
2004 2005 Total
Total T1 T2 T
USA A B C
INDIA X Y Z
right click on T1 and go to format field and write the suppress condition like this
numberVar d:=0;
currencyVar array arr1;
currencyVar array arr2;
numberVar e;
if GridRowColumnValue('year')=2004 then
(e:=e+1;
redim preserve arr1[e];
arr1[e]:=CurrentFieldValue)
else
(e:=e+1;
redim preserve arr2[e];
arr2[e]:=CurrentFieldValue);
false
right click on T and go to format field and write the Display string condition like this
currencyVar array arr1;
currencyVar array arr2;
totext(arr1[1]-arr2[1])
right click on A and go to format field and write the suppress condition like this
currencyVar array four;
currencyVar array five;
numberVar d;
if GridRowColumnValue('year')=2004 then
(d:=d+1;
redim preserve four[d];
four[d]:=CurrentFieldValue)
else
(d:=d+1;
redim preserve five[d];
five[d]:=CurrentFieldValue);
false
right click on C and go to format field and write the Display string condition like this
currencyVar array four;
currencyVar array five;
numberVar g;
g:=g+1;
ToText(four[g]-five[g])
Note: Please select the option "column totals on top" for crosstab in customize style
Hope this helps!
Raghavendra -
Calculated column shows all zeros in cross tab discoverer report
Hi
I have a calculated column in a cross tab report which shows all zeros, but when i duplicate the report as 'table' the calculated colun is getting populated.
i did not understand why it is doing like that, are there any special privileges or any special settings required for creating a cross tab report.Hi,
No there is no special privs for cross tab but there is an aggregation issue.
There are some methods of aggregations used in the discoverer.
First thing you can so is to make sure that in the cross tab sheet you use the detailed data points and that you are not combining different levels of aggregations (for example one amount in details and another one summed).
Second thing you can try is to change the aggregation for this worksheet, you can do that by going to the worksheet properties to the aggregation tab and try to change the settings.
Third thing is to check the pref.txt file in the application server and set "AllowAggregationOverRepeatedValues" to 1
BTW also search your data and find whether you got NULL values in the aggregated items, if so then wrap the data points with NVL function. -
Inserting a calculated column after every column in cross tab, in crystal report 2011
HI,
I want to insert a calculated column after every column i a cross tab . The cross tab shows , sales by region for a number of years , for example from 2007 to 2013. The year can be changed based on the user parameter. How can I do that ?
ThanksHi Feroz,
To calculate the Percentage Change and also to show the Percentage sign, here's what you need to do:
1) Right-click the Calculated Column Header > Calculated Member > Edit ColumnValue Formula and use this code:
cdate(1890,01,01)
If the field used as the column is a datetime field, use this:
cdatetime(1890,01,01,0,0,0)
2) Right-click one of the zero values in the Percentage Column and select Calculated Member > Edit Calculation formula and use this code:
if CurrentColumnIndex = 2 then
If GridValueAt(CurrentRowIndex, CurrentColumnIndex-2, CurrentSummaryIndex) = 0 then
0
else
(GridValueAt(CurrentRowIndex, CurrentColumnIndex-1, CurrentSummaryIndex) - GridValueAt(CurrentRowIndex, CurrentColumnIndex-2, CurrentSummaryIndex))/
GridValueAt(CurrentRowIndex, CurrentColumnIndex-2, CurrentSummaryIndex)
) * 100
else
If GridValueAt(CurrentRowIndex, CurrentColumnIndex-3, CurrentSummaryIndex) = 0 then
0
else
(GridValueAt(CurrentRowIndex, CurrentColumnIndex-1, CurrentSummaryIndex) - GridValueAt(CurrentRowIndex, CurrentColumnIndex-3, CurrentSummaryIndex))/
GridValueAt(CurrentRowIndex, CurrentColumnIndex-3, CurrentSummaryIndex)
) * 100
3) Right-click one of the Values in the summary cells > Format Field > Number tab > Customize > Currency Symbol tab > Click the formula button beside 'Currency Symbol' and use this code:
If Year(GridRowColumnValue("Date_field")) = 1890 then
"%" else "$"
Note: Replace Date_field with the field name you've used as the Column in the Crosstab. The double-quotes ARE required and you should remove any curly braces that CR adds automatically.
4) You might want to use a similar code in the 'Position' formula too.
Let me know how this goes.
-Abhilash
Maybe you are looking for
-
Switching from iPhone 3GS to iPhone 4
Hi all, Basically i want to buy a sim free iphone 4 off the apple store, and use the same contract ive got on my 3GS (just put the contract onto the iPhone 4) but i understand that the iPhone 4 uses a "micro sim" which would mean i wouldnt be able to
-
I have a 65GB iPod Touch 5--when turned on i get message: iPod is disabled, try again in 23,086,258 minutes. HELP!
-
Mac g5 crashes and burns multiple times a day... HELP!!!
Hello, I'm a recent mac user, been a pc kid for most of my life, and I just started using a g5 at work and I like the OS but the computer will randomly shut down without regard to any particular pattern. Most of the time it just freezes and won't res
-
Tried to download trial version of Photoshop CC and got an error message A12E5 what does it mean and what should I do.
-
I was able to do this on my older 27" iMac (2010). I could then hold down the Option key on startup and run either Mountain Lion or Snow Leopard. I've tried using a Time Machine backup, Carbon Copy Cloner, installing SL from another computer's dvd