cancel
Showing results for 
Search instead for 
Did you mean: 

Custom decimal number auto increment using a formula field

0 Kudos

Hi Team,

Need some help to have a formula field to show number sequence start as below in decimal pattern:

1.1

1.2

1.3

At present, we have below formula field logic to have auto numbering with end result in whole numbers like 1,2,3,..

WhilePrintingRecords; <br>numbervar srno;  <br> srno := srno + 1; .

Thanks in advance.

--

Regards,

AMP

DellSC
Active Contributor
0 Kudos

If I understand correctly, you want to increment by .1. Is there ever a time when you'll skip some of the decimal values and, for example, go from 1.4 to 2?

-Dell

0 Kudos

Thanks for your response.

Yes, it's continuous incremental without any skip of numbers.

-AMP

0 Kudos

Can someone please respond with a solution ?

--AMP

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Can anybody help me, please.

--AMP

ido_millet
Active Contributor
0 Kudos

In Crystal, the value assignment operator is ':=' rather than '=' so change

srno = 1; 

to

srno := 1;
0 Kudos

Thank you again for your response.

Tried updating as you suggested but results are not as expected. And even tried correcting with a small change in formula and results are not as expected. Below are the results for both the tried attempts.

Seems something is still to apply or correct but do not get it. Please see again and help me.

Thanks in advance.

--AMP

ido_millet
Active Contributor
0 Kudos

Simply initialize the variable to 1 in a report header formula.
Then use the formula you already have and increment by 0.1 instead of by 1

I suspect I don't understand where the real difficulty is. Can you clarify?

0 Kudos

Thanks for your response.

Sorry to bother you. I am just getting experience in Crystal Reports and no much idea on these kind of things.

Tried the suggested but could not get expected result. Below is the update..

Thanks in advance.

-- AMP