cancel
Showing results for 
Search instead for 
Did you mean: 

What does # do in a Formula?

andy0691
Member
0 Kudos

I've used Crystal Reports for over 30 years and don't remember ever seeing this and I've spent the majority of two days searching the .rpt and researching on the internet, but haven't found an answer.

I'm working with a complex report that calculates several sums, where some records are not included in the sum. The report is made up of a primary report and one sub-report.

The sub-report has a Formula named TScYardsM1 (see at end of this post). The Formula references #TScYardsM1. If I try to edit this formula, in any manner, it tells me "This field name is not known" and highlights the first occurance of #TScYardsM1. The formula adds #TScYardsM1 to the appropriate monthly total numbervar variable (e.g., SchYards1Var). There is nothing conditional in the formula, so the conditions must be related to the value of #TScYardsM1.

My guess is #TScYardsM1 is a reference to the TScYardsM1 Formula on the primary report, but if that is the case, I am wondering why I get the error trying to edit the sub-report's formula. Assuming I am correct about it referencing the parent report formula (I hate assuming), the primary report's formula (see at end of this post) references a group of numbervar variables (e.g., SchYards1Var). These variables are used to return variable values, but not set the variables.

  • How do I find what is setting the value of these variables (e.g., SchYards1Var)?
  • If my assumption is wrong about #TScYardsM1, what is this pointing too?
  • If my assumption is correct about #TScYardsM1, why do I get an error attempting to edit the Formula on the sub-report?

Sub-Report Formula TScYardsM1

if {@Month} = 1 then

(

shared numbervar SchYards1Var + {#TScYardsM1}

)

...

...

else

if {@Month} = 12 then

(

shared numbervar SchYards12Var + {#TScYardsM1}

)

Primary Report Formula TScYardsM1

if {@Month} = 1 then

(

shared numbervar SchYards1Var

)

...

...

if {@Month} = 12 then

(

shared numbervar SchYards12Var

)

Any and all help is greatly appreciated.

Thank you,

Andy

Accepted Solutions (0)

Answers (1)

Answers (1)

ido_millet
Active Contributor
0 Kudos

It's a Running Total.
You can see its definition in Field Explorer, under Running Totals.