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.

caluculation with CONTAINS, as opposed to EQUALS

Featured Replies

Is there a way to write a caluclation where a field CONTAINS, as opposed to equals?

I would like to have a calculation based on data from check boxes where I have multiple possibilites and I can only get it to work with radio buttons where there is only one possibility.

Use the PatternCount(text, search string) function. This returns the number of instances of search string in text, which could be a field or a static text value inside quotation marks.

  • Author

Thanks for your response, but I'm not sure it will help...

I have a daily sales DB, with sales of merch item.

Each merch item has a product description.

The product descriptions are in a value list from another file which will be edited often.

There is a daily fee which is calculated based on whether the product description is clothing or nonclothing.

Each day the defenition of clothing and nonclothing may change.

What I have been trying to do is allow the user to check which product description will be considered clothing that day and use those values in the fee calculation.

If(tour::clothing=productdescription, total, "0")

This calculation only works if there is one productdescripttion chosen, if there are 2 or more, it doesn't recognize any.

Is Tour::Clothing a global field that has your Product Description value list attached to it? If so, then perhaps this will work instead of your current calculation:

Case (PatternCount (Tour::Clothing, ProductDescription) > 0, total, 0)

Otherwise, I think I need more information on how your system is set up.

  • Author

clothing is not a global field.

Maybe if I explain my work-around, it will make more sense. Currently I have individual check boxes for every item being sold to designate whether the item is clothing or non-clothing.

I would like to the user to be able to choose which product descriptions are clothing or non-clothing rather than having to choose the individual item.

I have been trying to do this with a field called "clothing" with check boxes for the product descriptions; Tshirts, hats, jackets, CDs (which are from another file and will be edited often), but as soon as I check more then 1 box, the calculation breaks.

If I have understood the question than


if(isEmpty(Substitute

(Substitute(Substitute(Substitute(Substitute...//the number of substitutes has to be hardcoced :P //(tour::clothing,MiddleWords(productdescription,1,1),""),MiddleWords(productdescription,2,1),""),MiddleWords(productdescription,3,1),""),MiddleWords(productdescription,4,1),"")...//also this part has to be hardcoced : //,

"

Okay, I think I get it.

I think that you should apply your existing approach, i.e. indicating which individual items are clothing, to your product description file.

In the Product Description file, define a number field called Is_Clothing; this field will contain a 1 if Yes, 0 if No.

Then, you can build a relationship between Product Descriptions in your Daily Sales file to Product Descriptions in your Product Descriptions file and test to see if Is_Clothing is 1 or 0. If yes, then apply the fee. If no, then don't.

As far as user interface is concerned, you can create a portal showing all records from Product Description, listing the Product Description itself and Is_Clothing. Is_Clothing can be formatted with a checkbox drawing from a valuelist that has just one value: 1.

I hope this helps somewhat.

Create an account or sign in to comment

Important Information

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

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.