% Change in a Crosstab
Hello,
I have a question regarding Previous() usage in a crosstab.
Lets say i have data like below:
2007 2008
A 10 5
B 20
I am trying to show the % change, like this:
2008
A -50%
B -100%
The problem is that for Year=2008 there isn't any data for 'B'. so the Previous(measure) returns NULL and not 20 ?
I have tried using various contexts and the sort. Is there any way to do this ? Am i missing something ?
Thanks !
Hi Alan,
The problem seems to be that
IsNull([Value])
won't evaluate to anything because [Value] for 2008 doesn't exist.
I appreciate the input.
Thanks.
Srinivas
Similar Messages
-
Use case for multiple crosstabs under one datasource
I'm trying to understand why one would have multiple crosstabs for one datasource. When I change one crosstab, it changes the other crosstab. I was could have a different layout for multiple crosstabs.
Thanks.
Regards,
Mel CalucinHi Mel,
I am not following this question; would it be possible to rephrase it?
You could have multiple tabs for a data source - such as a one tab showing the result set in a cross tab and the other for a chart.
Tammy -
Hi, I'm using RAS to change some properties of report fields. I'm using Crystal Reports 2008 and VB.NET.
I have a CrossTab in which I have field for Row and field for column and Summery field. How can I access this field ?
Thanks FilippoHi Filippo,
There are no API's to make any changes to a Crosstab in any of our engines, actually there never have been. All you can do is alter to object size, color and other visual parts. Nothing within the crosstab itself.
Only option is to manually create the crosstab and then you can alter the field objects using RAS.
To get assistance to create a manual crosstab please post your question to the Report Design forum.
Thank you
Don -
Hi,
Say I have a crosstab with 3 Columns, Jan08, Feb 08, and Mar08 and two rows for Employee X. One row displays Sum of Sales while the other displays Sum of Commissions.
Here's what I want to do:
If the Sum of Sales is below zero then make Sum of Commissons field RED otherwise DefaultAttribute OR
if the previous month's Sum of Sales was below zero, make this month's Sum of Commissions field RED as well. So take this scenario for example
Jan08 Feb08 Mar08
Employee X
Sum of Sales -20 10 30
Sum of Commisson 15 35 40
I want the values 15 and 35 to be RED in this example.
Yesterday, I learned how to figure out the first part of my logic: (if the Sum of Sales is below zero then make Sum of Commissions field RED otherwise DefaultAttribute) Here's the logic for that
In Sum of Sales Suppress X+2 Conditional Formula add this:
whileprintingrecords;
numbervar i;
i:=currentfieldvalue;
false
Now you have the sum of sales in the variable i; so right click on the sum of commision field and go to font color and write this
whileprintingrecords;
numbervar i;
if i<0 then
crred
else
defaultattribute
So, how can I accomodate the second part of the OR clause?, namely:
OR
if the previous month's Sum of Sales was below zero, make this month's Sum of Commissions field RED as well.
Thank you in advance,
Zack H.
Edited by: Zack H on Sep 9, 2009 10:39 AMRaghavendra,
I'm almost there I can taste it.
So here's what I've done so far.
I created a formula called {@Setting x} and placed it in the Report Header.
Whileprintingrecords;
global numbervar x;
x:=1;
I created a formula called {@Store Array Values} and placed it in details section (its a summarized table so detail section is fine, stores right results);
whileprintingrecords;
global numbervar array arr;
global numbervar x;
redim preserve arr[1000];
arr[x]:={Table.Value};
x:=x+1;
In the Crosstab's format field -> Font tab -> the conditional formula now looks like this.
whileprintingrecords;
global numbervar i;
global numbervar array arr;
if i<0 or arr[6]<0 then
crRed else
DefaultAttribute
I just inserted 6 as that is the row that has a negative Sum of Sales. This actually turned all the Sum of Commissions row RED. Obviously I am missing the step where I need to have the array dynamically change as each crosstab column changes so I don't have to hard-code the 6 (as shown in this example). Any ideas?
Thanks again,
Zack H. -
Change chart object with crosstab base not work
Hi
I use this simple script to change some settings on the chart. Is a chart base on a crosstab, an error occurs: " The chart data fields are not valid.". All other chart not base on a crosstab work fine. Why?
Example:
Public Sub test(ByVal strTempFile As String)
Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim crROC As CrystalDecisions.ReportAppServer.Controllers.ReportObjectController
Dim crAppChart As CrystalDecisions.ReportAppServer.ReportDefModel.ChartObject
Dim crAppChartNew As CrystalDecisions.ReportAppServer.ReportDefModel.ChartObject
rpt.Load(strTempFile, OpenReportMethod.OpenReportByTempCopy)
crROC = rpt.ReportClientDocument.ReportDefController.ReportObjectController
For Each crAppChart In crROC.GetReportObjectsByKind(CrystalDecisions.ReportAppServer.ReportDefModel.CrReportObjectKindEnum.crReportObjectKindChart)
crAppChartNew = crAppChart.Clone()
crAppChartNew.ChartStyle.TextOptions.DataLabelFont.Font.Name = "Arial"
crROC.Modify(crAppChart, crAppChartNew) 'Error: The chart data fields are not valid.
Next
End SubWell, let's stick with one issue. If you want to discuss other issues, create a new thread per each one ([Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement]). Re. charts based on xtabs. Try to create the chart in the designer first. Then try to create it in code. Even in the designer, the chart must be quite basic. E.g.; no multiple summaries. Also, can you create a chart in your code on a report that has no xtab?
Ludek -
Change Column Header from Crosstab
Hi, can I change the column's header from a crosstab in a JSP?, by example, I have a crosstab with one column where the header said "Product", and I want to change it to "Product A".
thanks.Hi,
by making use of specific report column templates and column template conditions you can change the headers dynamically.
See this http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/ui_templt.htm#HTMDB25708 for more info.
regards,
Erik-jan -
Hello,
does anybody know how to change the header row of a crosstab in the designstudio manually ? So i have currently some technical names and some descriptions as header and i want to have other names in the header.
Thanks in advanceYou could change them in the properties of the BEx query
Another idea (I have not tried this) - but I see Ilya made this suggestion using CSS -see Re: cross tab - change column name
Good luck -
Changing row colors in crosstab with static structure
Hello,
I've a crosstab that consists of several key figures (static structure) in the rows and the fiscal period in the columns:
_____________|__January | February | March | .....
Key Figure 1 | 3
+ Key Figure 2 | 4
= Sub Total | 7
+ Key Figure 3 | 1
= Overall Total | 8
Now, I'd like to assign different (background) colors to the key figures resp. totals in the rows in order to make them better readable. Is this possible?
I've already had a look at the custom style-sheet method described in http://scn.sap.com/community/businessobjects-design-studio/blog/2013/07/21/design-studio but that's not the same what I'd like to do...
Does someone have an idea on how to realize this?
Thanks and best regards,
PatrickI have a question related to your last post.
I have a crosstab layout. I have setup custom CSS for my learning purposes. I am currently using 1.4 in a local install on my PC.
Here is the CSS I am using for the layout.
.sapzencrosstab-DataCellAlternating {
background-color: #CCFFCC !important;
.sapzencrosstab-DataCellDefault {
background-color: #EAF2D3;
/* This defines how tall the rows will be in the cross tab layout*/
.sapzencrosstab-DataCellContentDiv {
height: 40px;
/* This formats the Task Count with a gradient yellow*/
.sapzencrosstab-DataCellTotal {
font-weight: bold;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#E6E600',GradientType=0); background-color: rgb(229, 234, 243); !important;
With the above CSS, I can get the Overall Result count to show up in yellow.
My goal is to get the cell that contains the Overall Result text to show up formatted the same way the count is formatted. (Gradient Yellow)
I looked at, and tried your solution, but it did not work for me. Is there a better way to do this?
Thanks,
Lloyd -
Customizing Crosstabs - column to show change between periods
I didn't see anything addressing this issue. I'm new at CR using XI and would really appreciate a little coaching.
I've created a report to list average aged account days
GRP1 Grp2 GRP3
200912 201001 201002 201003
MVHE BEAVERCREEK FAMILY MEDICINE 0.0 0.0 11.9 18.0
Total 0.0 0.0 11.9 18.0
SAMARITAN
FAMILY
CARE FAMILY MEDICINE OF HUBER HEIGHTS 0.0 9.6 20.3 17.6
NORTHWEST DAYTON PHYSICIANS 12.3 23.0 27.9 38.5
Total 12.3 21.0 26.5 29.9
Grand Total 12.3 21.0 19.7 23.1
GRP2 are locations for a GRP1 division. GRP3 columns are prior months. I'd like to add a column that would show amounts in 201003 column minus 201002.
Also, I'd like to show column headings as mmm yyyy instead of yyyymm. I tried a formula but got Feb 2010 in all columns althought the tool tip showed the same field after applying the formula as before.
Finally, I'd like the grp2 total label to be the row value in grp1. Does this make sense?
Thanks.
Edited by: wndavis on Apr 30, 2010 8:11 PM
This looked nice in columns until I posted it. It may look better if you get into edit mode.Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551 -
Crystal Repts XI - Adding labels to summary fields in crosstab report
I have a crosstab report where
Columns
first-level are priority or non-priority schools
second-level are priority type
Rows
First-level: month
second-level: count of calls opened this month; sum of time spent; opened prior to reportstart and still open, closed this month
The row label for sum of time spent specifies that the time is in hours. However, our Curriculum and Instruction department wants each data cell in that row to include the abbreviation hrs. In other words, the row label would say Time spent on requests closed this month(hrs) and each cell would say 10.5 hrs 2 hrs, etc. Can anyone help with this?Thank you! This solved my problem. It took me awhile to find where I could change the currency sign to display on the right but once I did it worked like a charm (we're and educational system, we rarely get to report on money).
For others who don't know where to find this:
- right click the field and select Format Field
- on the Number tab of the format editor, select Display Currency Symbol
- click Customize
- click the Currency Symbol tab of the Custom Style Editor
- in the Position menu choose the selection with the currency symbol on the right
- in the Currency Symbol box type hrs.
Save, save, and done! -
Crosstab shows empty sums when multiple rows are involved
Hello,
Here are the top few lines from a crosstab report I've generated:
Billing Percentage Billing Amount Billing Tax Percentage Billing Tax Amount
Billing Type Rental VAT Rental VAT Rental VAT Rental VAT
Release Code Booking Number
MYRELEASE
34806 50 NULL 7544810 NULL 5 NULL 377240 NULL
34810 NULL NULL 100000 NULL 5 NULL 5000 NULL
34811 NULL NULL NULL NULL
34812 NULL NULL NULL NULL
34813 NULL NULL NULL NULL
34822 NULL NULL 100000 NULL 5 NULL 5000 NULL
Although this probably looks terrible in HTML, hopefully everyone can see that for 34806 and 34810, sums are returned correctly. However, for 34811-34813, the sums are returned as NULL.
After looking into the database, it appears that the sums only show when there is only a single element making up the sum. For line 34811, there are 2 underlying records which should be getting summed up, but the report is showing NULL.
I have read some suggestions including changing the default aggregation behavior to show the sum of the contributing cells - but this does not fix anything. Also, I have verified that in the EUL, the data type is "NUMBER" and the default position is "DATA POINT".
It may be worth noting that the multiple underlying records often contain duplicate data in the amounts that are being summed up. Could this be the issue? If so, how do I get Discoverer to sum up these values despite the fact they are dupes?
Thanks!Okay, how about making sure the items are non-NULL similar to what Puppethead suggests.
It sounds like you're choosing the SUM for an item for display. Regardless if it's a SUM or DETAIL on the line row level, if there's any NULL in each of those SUM line records, it may be screwing up the total.
So, where you choose the item name, instead put an NVL function around it (ie: NVL(item,0)).
Russ -
How to use a single formula in multiple crosstabs
Hi, I have 2 crosstabs, each in separate subreports, which are both combined into my overall report. I'm formatting the background color of a field in each crosstab using a background color formula in each crosstab.
I'm applying the formula by right-clicking the field, selecting "Format Field," selecting the "Border" tab, then clicking the formula button next to "Background."
This works fine. However, both crosstabs use the same exact formula, so I must change it in two places every time. Is there a way to write the formula once, and use it in each crosstab?
I tried just creating a new formula from the Field Explorer and calling it in each crosstab, but I'm using "currentfieldvalue" in my formulas, and I got an error saying the function could only be used in field formatting formulas.
Crystal Reports XI
Thanks!Hi..
You are using two sub reports in one report, I don't think we can have a single formula to apply on a diffrent cross tab reports. As you said you are using CurrentFieldValue in your formula, this can be used only in cross tab field format.
You have to write separate formulas for your two cross tab reports
Thanks,
Sastry -
How to delete the Data Points label with a crosstab layout
Hi, just a question.
I created a report which uses a crosstab layout; so...I have the Company Name on the left, Status Code above and the Count(tickets) as Data Points.
As soon as I put the Count(tickets) inside the report, the label "Data Points: Incident Id Count appears above just at the bottom of the Status Code
Is there a way to avoid this tedious label ?
As workaround, I changed the Data Points' format heading (text and background) in such a way to see only a Grey space...but this is not so useful (from the customer side...)
I also looked for inside the crosstab layout properties...but I didn't found nothing.....
Any help will be appreciate
AlexWell, I think you are out of luck. You are basically saying you want to control when you have a column heading and when you don't want to have a column heading. Most of us users do want column headings in our reports. In fact I have a hard time trying to figure out why you don't want a column heading. How are the report users going to know what the numbers in the column mean if you don't have a heading on the column? Maybe the initial users of the report know, but what happens when they leave and someone else takes over their duties? I would suggest putting in an enhancement request for Discoverer to give you the option to not display a column heading, if you really want something like this. This needs to be at the workbook level, I am thinking.
John Dickey -
Help in Pivot Query- To change the column data to rows data!
Hello Gurus -
I have to change the row to Column -
When i use the query -
select NVL (T2.NAME, ' Grand Total') AS State,count(T2.NAME) as Total
from Defect T1,statedef T2,repoproject T3
WHERE T1.STATE=T2.ID AND T1.repoproject = T3.dbid AND T3.name like '%Compass Juice' GROUP BY ROLLUP (T2.NAME)
Then i have got the following data -
STATE TOTAL
Analysis 17
Closed 1302
Development 9
Duplicate 24
Failed 2
OnHold 4
Opened 146
QA 1
ReadyForQA 1
Withdrawn 335
Grand Total 1841
But i want the data in following format -
State Analysis Closed Development Duplicate Failed OnHold Opened QA ReadyForQA Withdrawn GrandTotal
Total 17 1302 9 24 2 4 146 1 1 335 1841
Kindly help me with this. I searched the forum and saw the usage of Max and NVL, Decode but i am unable to understand it to use in my query. kindly help me with this.Hi,
In 11g you can use pivot.
[http://www.oracle.com/technology/pub/articles/oracle-database-11g-top-features/11g-pivot.html]
example
SQL> desc customers
Name Null? Type
CUST_ID NUMBER(10)
CUST_NAME VARCHAR2(20)
STATE_CODE VARCHAR2(2)
TIMES_PURCHASED NUMBER(3)
When this table is selected:
select cust_id, state_code, times_purchased
from customers
order by cust_id;
The output is:
CUST_ID STATE_CODE TIMES_PURCHASED
1 CT 1
2 NY 10
3 NJ 2
4 NY 4
... and so on ...
Note how the data is represented as rows of values: For each customer, the record shows the customer's home state and how many times the customer purchased something from the store. As the customer purchases more items from the store, the column times_purchased is updated.
Now consider a case where you want to have a report of the purchase frequency each state�that is, how many customers bought something only once, twice, thrice and so on, from each state. In regular SQL, you can issue the following statement:
select state_code, times_purchased, count(1) cnt
from customers
group by state_code, times_purchased;
Here is the output:
ST TIMES_PURCHASED CNT
CT 0 90
CT 1 165
CT 2 179
CT 3 173
CT 4 173
CT 5 152
... and so on ...
This is the information you want but it's a little hard to read. A better way to represent the same data may be through the use of crosstab reports, in which you can organized the data vertically and states horizontally, just like a spreadsheet:
Times_purchased
CT NY NJ ... and so on ...
1 0 1 0 ...
2 23 119 37 ...
3 17 45 1 ...
... and so on ...
Prior to Oracle Database 11g, you would do that via some sort of a decode function for each value and write each distinct value as a separate column. The technique is quite nonintuitive however.
Fortunately, you now have a great new feature called PIVOT for presenting any query in the crosstab format using a new operator, appropriately named pivot. Here is how you write the query:
select * from (
select times_purchased, state_code
from customers t
pivot
count(state_code)
for state_code in ('NY','CT','NJ','FL','MO')
order by times_purchased
Here is the output:
. TIMES_PURCHASED 'NY' 'CT' 'NJ' 'FL' 'MO'
0 16601 90 0 0 0
1 33048 165 0 0 0
2 33151 179 0 0 0
3 32978 173 0 0 0
4 33109 173 0 1 0
... and so on ... -
Post Author: EdHaberstroh
CA Forum: Charts and Graphs
I would like to report the net change or percent change between columns in crosstab report. is that possible?Hi Oddmar,
design studio in current release (1.4) is taking the date / time formats from user locale which is set by your browser. You are probably in EN, therefore the English formatting is taken.
see admin help, https://websmp109.sap-ag.de/~sapidb/012002523100018707472014E/ds14_admin_bip_en.pdf
8.4 Regional Formats for Numbers, Dates and Times
The format for numbers, dates and times varies according to the defined language setting in the BI launch pad or
the Web browser.
● If you define a language in the BI launch pad under Preferences Locales and Time Zone Preferred
Viewing Locale , this language is used, and numbers, dates and times are displayed in the appropriate
format.
● If you select Use browser locale under Preferences Locales and Time Zone Preferred Viewing Locale ,
the Web browser language is used, and numbers, dates and times are displayed in the appropriate format.
--> this means the SU01 settings are not evaluated (yet, as probably this extension needs to come at some time, not sure if for BIP deployment as this one can be used against many ABAPs.).
Karol
Maybe you are looking for
-
Prevent XI from converting & #163; to pound character
The requirement is in input XML file & #163; comes..by default in output file xml it is converting the above grouped of characters to £ sign. how do I retain & # 163; in output xml file without writing any adapter module for solution Points will
-
Rendering quality always lower than original video
I have some footage that I recorded with my Contour Roam HD Camera and I have edited it in Adobe Premiere Elements 10.0, but every time I render the video that I've edited, the footage comes out at a reduced quality. I can visibly see that it is red
-
Hello, I'm trying to develop applications for Android. 1) I have the version of Flash included in Cs5 with solme litle examples of air, I need to download something else or air is already full? 2) there are some examples, on the web, of applications
-
Hi All, The document library, list, discussion board contents are not loading only in certain computers. Javascript error also appears in status bar. How to resolve it? any suggestions?
-
Changed footer info and it automatically propagated other pages; how?
This happened once by accident, and I want to know how to do it on purpose in Acrobat 7 Pro. I was updating version/issue and date in the footers, starting from the beginning of the document using touch up text tool. To my pleasant surprise, when I w