7 Replies Latest reply on Jan 27, 2010 11:02 AM by Steve Wright

# Can Someone Suggest a Calculation Formula?.....

### Title

Can Someone Suggest a Calculation Formula?.....

### Post

Hello All,

We would like to have a product serial # generated and displayed on our invoices.  The # needs to be the Model # (AF 130810) followed by the invoice date.  Example = AF 130810 1/24/2010.  Here is what I have so far.

-An 'Invoice Generator' field with a radio button set where users check the appropriate model #.

-A calculation field that displays the compiled serial number.

Here is the equation that compiles the serial number:

Case(Booth Serial # Generator = "AF 130810" ; "AF 130810" and Lookup (All Invoices::Date))

This calculation just reports the # "1".

Can anyone suggest an equation that will accomplish this task?

Thanks,

Andrew

• ###### 1. Re: Can Someone Suggest a Calculation Formula?.....

and is a logical operator that returns 1 if the values on either side are both "True" (any value other than 0, blank).

Use & in place of and to concatentate (glue together) your two values.

• ###### 2. Re: Can Someone Suggest a Calculation Formula?.....

Phil,

This equation:

Case(Booth Serial # Generator = "AF 130810" ; "AF 130810" & Lookup (All Invoices::Today's Date))

Produced this Result:

AF 130810?

Also,

Can I increase the amount of tests and results to cover my whole product line, like:

Case(Booth Serial # Generator = "AF 130810" ; "AF 130810" & Lookup (All Invoices::Today's Date)) Case(Booth Serial # Generator = "AF 141026" ; "AF 141026" & Lookup (All Invoices::Today's Date))

ETC.....?

Thanks,

Andrew

• ###### 3. Re: Can Someone Suggest a Calculation Formula?.....

Im not sure im reading this correctly, so my apologies just in case... but why not use :

case (not isempty( Booth Serial # Generator) ;

Booth Serial # Generator & " " & Get(CurrentDate) )

• ###### 4. Re: Can Someone Suggest a Calculation Formula?.....

SW,

Same result!

This equation:

Case(Booth Serial # Generator = "AF 130810" ; "AF 130810" & GetField (Today's Date ))

Yields:

AF 130810?

Good Idea though.

-Andrew

• ###### 5. Re: Can Someone Suggest a Calculation Formula?.....

I didnt put a space in the calc... plus you are using getfield in the wrong way, you dont need to use Getfield atall here.

Case(Booth Serial # Generator = "AF 130810" ; "AF 130810" & " " & Today's Date )

• ###### 6. Re: Can Someone Suggest a Calculation Formula?.....

SW,

Awesome!  (BTW, I like the graphic explanation.)

Now,

Is there a way to link other tests / results in the same equation?

We have 5 products in our line

AF 130823

AF 130810

AF 141026

AF 141230

AF 161635

Can I link multiple 'Case'  functions together?

Thanks,

Andrew

• ###### 7. Re: Can Someone Suggest a Calculation Formula?.....

Set up your value list and radio button set for the Booth Serial # selection field.

Because the selected radio button will contain the Serial number value, there is no need to reference it in the calculation directly

Simply change the calculation to be

Case( not isEmpty(Booth Serial # Generator) ; Booth Serial # Generator  & " " & Todays Date )

Any serial you have in your value list will be used.

[x] AF 130823   (selected)

[ ] AF 130810

The calc would return exactly what you required

AF 130823 27/01/2010

If no booth no was selected, the calc result would be empty

Case (

test1 = "expected"  ;  Result1  ;

test2 = "expected"  ; Result2

)

If none of the tests applied, the result would be empty

Or

Case (

test1 = "expected"  ;  Result1  ;

test2 = "expected"  ; Result2  ;

Result3

)

Result3 would be returned if none of the tests applied.