Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Extracting data

Featured Replies

I'm needing a calculation field that returns only a portion of another field (Product_Number).

 

For Product_Number 0797-8851-1 the result should be 797 (no leading zero)

For Product_Number 5-4781-3-43 the result should be 5

For Product_Number 579-287-9-154 the result should be 579

 

Get the idea?

 

The result should equal the number before the first dash (except if there is a leading zero). In the case of a leading zero, I do not need the leading zero.

Let ( [
    _returnDelimited = Substitute ( "0797-8851-1" ; "-" ; ¶ ) ;
    _firstValue = GetValue ( _returnDelimited ; 1 )
] ;
    GetAsNumber ( _firstValue )
)

Try:

GetAsNumber(Left(Product_Number;Position(Product_Number; "-"; 1; 1)-1))

  • Author

THANKS !!!

Both solutions work GREAT.

  • Author

Ok, I didn't think I would need this when I posted my original question, however, it looks like I will need an additional calculation field that yields the number between the first dash and the second dash also. 

For Product_Number 0797-8851-1 the result should be 8851

For Product_Number 5-04781-3-43 the result should be 4781 (no leading zero)

For Product_Number 579-287-9-154 the result should be 287

 

Sure appreciate any help getting this solution.

 

Thanks

8 minutes ago, kcep said:

it looks like I will need an additional calculation field that yields the number between the first dash and the second dash

You should have known how to do this by adapting the solutions given to your original question:

jbante's:

Let ( [
values = Substitute ( Product_Number ; "-" ; ¶ ) ;
secondValue = GetValue ( values ; 2 )
] ;
GetAsNumber ( secondValue )
) 

doughemi's:

Let ( [
start = Position ( Product_Number ; "-" ; 1 ; 1 ) + 1 ;
end = Position ( Product_Number ; "-" ; 1 ; 2 ) ;
mid = Middle ( Product_Number ; start ; end - start )
] ;
GetAsNumber ( mid )
)

 

  • Author

Thank you very much :)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.