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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help w/ formula to select summary source would be much appreciated

Status
Not open for further replies.

gravy

IS-IT--Management
Jul 24, 2001
3
US
Let me explain a little bit... <br><br>I have a report already created with a bunch of summaries.&nbsp;&nbsp;Im trying to create identical summaries except this time summarizing different fields.&nbsp;&nbsp;The summary operations will still be the same though.&nbsp;&nbsp;<br><br>The first report summarizes fields which look like the following:<br><br>GenInf1, GenInf2, GenInf3, etc... <br><br>The &quot;GenInf&quot; represents the category, and the number represents the number within that category.<br><br>Im looking to recreate those same summaries except for different categories.<br><br>So I was thinking would it be possible to create something that asked me for the Category and then build the summaries based on the what I entered ?<br><br>I was thinking something like this:<br>instead of having &quot;avg of GenInf1&quot; for example as a summary.. it would be &quot;avg of %category%1&quot; where &quot;%category%&quot; would be a variable determined by what I enter. <br><br>I just dont know how to do that in CR.. Im using version 8 btw.<br><br>I hope my explanation is clear... Im new to Crystal Reports so I'm unfamiliar how to do these things, but once I have a start then I should be able to get going with it and adapt it to my needs fairly easily.&nbsp;&nbsp;I havent had much time to familiarize myself with it as Im under the gun with a deadline and was sort of just thrown on this :\<br><br>Any help will be much appreciated... thanks in advance <br><br>
 
Ok.. heres what I've done so far after looking at a little crystal syntax:<br><br>Global StringVar catgry;<br>catgry := &quot;{tablename.GenInf&quot;;<br><br>Global NumberVar q1;<br>Global NumberVar q2;<br>Global NumberVar q3;<br>Global NumberVar q4;<br>Global NumberVar q5;<br>Global NumberVar q6;<br>Global NumberVar q7;<br>Global NumberVar q8;<br>Global NumberVar q9;<br>Global NumberVar q10;<br>q1 := catgry + &quot;1}&quot;;<br>q2 := catgry + &quot;2}&quot;;<br>q3 := catgry + &quot;3}&quot;;<br>q4 := catgry + &quot;4}&quot;;<br>q5 := catgry + &quot;5}&quot;;<br>q6 := catgry + &quot;6}&quot;;<br>q7 := catgry + &quot;7}&quot;;<br>q8 := catgry + &quot;8}&quot;;<br>q9 := catgry + &quot;9}&quot;;<br>q10 := catgry + &quot;10}&quot;;<br><br><br><br>Now I have a problem though... when I try to use q1, q2, etc.. in a function like Average(q1)<br><br>It just sees it as a string instead of pulling the value from the database.. and so it complains about not having a number field in the average function.&nbsp;&nbsp;Im stuck at the moment.. anyone provide some help ?<br><br>-Thanks
 
Well I ended up using a parameter field to give me a choice and then using formulas for each question... then just did summarys for the formula fields.<br><br>Worked like charm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top