cancel
Showing results for 
Search instead for 
Did you mean: 

Crosstab - GridRdowColumnValue and CurrentFieldValue

Former Member
0 Kudos

I am attempting to use either the GridRowColumnValue or CurrentFieldValue function to get the value of a Crosstab data cell.

My Crosstab has one row (named "endtime") and one column (named "constant").

It has four (4) summarized fields displayed horizontally.

I want to access the third (3rd) horizontal field.

I have tried using the CurrentFieldValue function - but it seems to get some other value used in the report.

I have not been able to determine what value it is returning, but I know it is not the third (3rd) horizontal field.

Does anyone have any thoughts?

Thanks in advance!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Gentlemen,

I am trying to access the current cell value as part of the "Rt Click - Format - Common - Display String" attributes of the Crosstab cell.

Also, there is only a single column, but there are four (4) horizontally displayed values within that single column.

My problem - is I want to access the third (3rd) values within that single column.

Does this make any sense?

Thanks in advance!

Dan

Former Member
0 Kudos

Dear All,

I thought the picture below may help to explain my predicament.

-


constant

-


endtime

1st-val 2nd-val 3rd-val 4th-val

-


So - "endtime" is the row label. and "constant" is the column label.

I want to access just the "3rd-val" from the "Display String" attribute.

Does this help explain my problem?

Dan

former_member260594
Active Contributor
0 Kudos

Dan,

You can format the 3rd values display string with a display string formula. The formula will evaluate for every occurance of that summarized field but you can use the gridrowcolumnvalue function to narrow down which value is affected so the logic in the previous post is valid but I don't know exactly what you are trying to display.

Former Member
0 Kudos

I really appreciate your patience - while I try to explain myself.

I will try to "draw" what my screen looks like.

It is a crosstab control to summarize a series of counters over a period of time.


+----------------+-----------------------------------------------------------------------+
|                |                               constant                                |
+----------------|-----------------------------------------------------------------------+
|    endtime     |        Sum-1st        Sum-2nd        Sum-3rd       Percent-4th        |
+----------------|-----------------------------------------------------------------------+
|    endtime     |        Sum-1st        Sum-2nd        Sum-3rd       Percent-4th        |
+----------------|-----------------------------------------------------------------------+
|    endtime     |        Sum-1st        Sum-2nd        Sum-3rd       Percent-4th        |
+----------------|-----------------------------------------------------------------------+
|    endtime     |        Sum-1st        Sum-2nd        Sum-3rd       Percent-4th        |
+----------------|-----------------------------------------------------------------------+

There is a single defined row - endtime - which represents a date - the data rows are grouped by the date.

There is a single column - constant - which is used a "dummy" column header.

Since I only want the totals for the counters with no sub-groupings,

I created a formula called "@constant" - that simply generates an empty string.

I then defined four (4) "Summarized Fields" - since they are independent - I don't want them "grouped".

So, the resulting "print" of the crosstab looks like what I have drawn above.

I want to use the "running" values of the "Sum-3rd" summarized value to compute the the "Percent-4th" summarized value.

So, in the "Display String" formula for the "Percent-4th" summarized value, I am trying to obtain the value of the "Sum-3rd" summarized value.

Does this make any sense? I really hope so!

If this is not possible, is there a different approach I can take to generate my output?

Thanks a bunch for taking the time to listen!

Dan

former_member260594
Active Contributor
0 Kudos

Dan,

Check out this sample report https://boc.sdn.sap.com/node/19851

It doesn't do exactly what you are looking for but you should be able to adapt the logic in it to get what you need.

Former Member
0 Kudos

Graham,

Yes - with the information you provided - I was able to use the "Sum-3rd" to compute the "display" of the "Percent-4th".

Thank you very much!!

However, I now have a new issue.

I would like to use the Crosstab data to generate a "chart".

While I can do this with no problem - the chart of the Crosstab is based on the "CurrentFieldValue" - not the "displayed" value of the "Percent-4th" summarized value.

Is there any way to get the "chart" to use the "displayed" value of the "Percent-4th" summarized?

The "chart" feature only lets you use "WhileReadingRecords"-type formulas - it will NOT let you use "WhilePrintingRecords"-type formulas.

Any thoughts on a work-around?

Thank you for your time and patience - in advance!!!

Dan Welfle

former_member260594
Active Contributor
0 Kudos

Dan,

Unfortunately there is no way for a crosstab chart to process the displayed data, only the original data.

There is a however a workaround to charting on WhilePrintingRecords. Check out the following document;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40e7130d-aa1e-2b10-ce9f-eee2a54ff4cd

Former Member
0 Kudos

Graham,

I obtained and read the document from the link you provided.

It works great - when using CR in the standalone mode.

However, I am forced to use CR within the confines of the Clear Quest (CQ) environment.

Everything behaves the same as the CQ-stand-alone mode - except for one little detail.

In the CQ environment, I can not get the "Selection Formula - Record" to "parse" the concatenated-strings.

Any thoughts?

Thanks in advance!

Dan Welfle

Answers (3)

Answers (3)

Former Member
0 Kudos

A new "condition" was encountered that needed additional information.

Former Member
0 Kudos

not to nit-pick, but wouldn't it have to be a 'shared currencyvar' to reference it in another formula?

former_member260594
Active Contributor
0 Kudos

Shared variables allow variables to be referenced between main reports and subreports. Global variables allow for referencing between formulas in the same report and by default a variable is of the Global scope unless otherwise specified

former_member260594
Active Contributor
0 Kudos

Dan,

Where are you trying to reference the value of a crosstab cell? You can only do this within formatting formulas of the crosstab cells.

For instance you could assign the currentfieldvalue of a cell in a conditional suppression formula of the 3rd summarized value where the columns are based on country and rows on region and the they have been Aliased as Country and Region;

Currencyvar n;

If GridRowColumnValue( "Country" ) = "USA" and GridRowColumnValue( "Region" ) = "AZ"

then n:= currentfieldvalue;

false

The variable n is only assigned the third summarized value when the column equals USA and the row equals AZ. You can then reference this variable later on in the report.