Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula value to change

Status
Not open for further replies.

HPNAGA

Programmer
Mar 22, 2013
17
US
Hi

I am using Business objects XI.
I want to know if there is a way to change the value of a formula based on the section it is..
Lest say i have a group footer and i have two sections Sec A and SEC B.

In Sec A the value should be 1
in Sec B the value should be 2

please let me know if you need more information...

Thanks in Advance
 
It's easy enough to have a formula that tests the data item that's been used to group.

I assume you know that and are after something that gives 1 for the first group, 2 for the next and so on.

A running total that increments once per group would do this. Right-click on a suitable data field and you'll find it among the Running Total options

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
I think the question is concerning multiple footer (or header) sections for a single group. If that's the case, I am not aware of a way for Crystal to know which section a formula is in. You may have to create a formula for the second section.

For example
GF1a insert your field. Lets assume the field value is 1
GF2a insert a formula like {db.field} + 1. This would result in 2

Maybe someone knows a better solution for that?

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
correction .. sorry its early for me :)

For example
GF1a insert your field. Lets assume the field value is 1
GF1b insert a formula like {db.field} + 1. This would result in 2

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
Hi

Thank you so much for posting the reply..
Well the solution does not work in my situation..
let me explain in detail how it will not work..

I need to change the formula based on the section or Group footer...
like In section A it is always 'STATE' funding code
in Section B it is always 'Federal' funding code.


I have two sections one for State and one for Federal in each group. I have like this groups around 4....The formula is same for both except for the condition IF xyz = ' State' in section A and in section B it is if xyz = 'Feberal'...this is the issue if anybody can tell me how to do it i will be more than gald...however if this is not clear then let me know what information is needed from my side...
 
Im still not clear ... define "section"



_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
HI Just the update...I just tried it and event he numbers does not increment...
in Report Header i have a TestINIT formula ....Numbervar X:= 1
in Details A i have Test1 formula ....numbervar X := numbervar X + 1;
in details B i have place the same Test1 formula...

The result was like

Report Header 0
Details A 2
Details B 2

so it does not work even for the numbers :(
 
if you added a section to the group footer (one for state and one for federal... you will need to formulas


on should say if xyz = 'state' then whatever results you want and place that in the GF1a section
the other should say if xyz = 'federal' then whatever federal results you want and plae that in the GF1b section

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
By Section I mean Report section part ...in this example Details Section A, Details Section B ...
 
if you added a section to the group footer (one for state and one for federal... you will need to formulas


on should say if xyz = 'state' then whatever results you want and place that in the GF1a section
the other should say if xyz = 'federal' then whatever federal results you want and plae that in the GF1b section


The whole point is to cut down the formula to one as we have around 2500 formulas to write and then if there is a change then we have to go thru all of them ...So to merge both formulas in to one is what we are trying to do ...somehow tell the formula in Section A calculate for State and in Section B calculate for Federal..
 
if this is what you are talking about ...
Link
then whatever you place in detail a will be exactly the same if you put it in detail b.

Could you group again by xyz field? this will get the basic results you are talking about but it sounds like your report may be too indepth for this solution

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
Thank you for the prompt responses...
Yes I can't group based on XYZ...otherwise that would have solved the situation before...
The section A and Section B are in Group footer section rather than Details section...while i was doing a test report i just simplified it...I just created a group and place the same formulas in the group footer section however it still acts the same...
 
yep ... that's how the sections work. I have needed this functionality before and maybe someone else can help. Would be kind of sweet if there was a special field similar to GroupNumber. Running totals wont work either for that scenario. Unless there is a better suggestion you may just be stuck with a lot of formulas

_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top