Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Calc Field with Container Result


This topic is 7845 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have this working for "CL", now I want to add checks for other letter combinations. Such as DL-N, Dl-A etc... How do I add these other tests. I am pretty new at this so I imagine it is easy.

If(PatternCount(ling_2, "CL") > 0, cl_bar_image, "")

Thanks for your help in Advance

norm

Link to comment
Share on other sites

Assuming that you want to enter another image if one of the other tests is met, the best way is to use the "Case" funtction:

Case(PatternCount(ling_2, "CL") > 0, cl_bar_image,

PatternCount(ling_2, "DL-N") > 0, dl-n_bar_image, "")

Of course, you can put in as many tests as you want.

Link to comment
Share on other sites

Thanks for your quick reply. Here is what the calc looks like. However it does not seem to work. The field were the CL comes from (lin_2) is a popup menu. Does this matter? I go to the layout with the CL or Dl-N and go back to the container field and the image has not loaded. Any ideas?

Case(PatternCount(ling_2, "CL") > 0, cl_bar_image,

PatternCount(ling_2, "DL-N") > 0, dln_bar_image,

PatternCount(ling_2, "DL-A") > 0, dla_bar_image,

PatternCount(ling_2, "DL-J") > 0, dlj_bar_image, "")

Thanks for your help in Advance

norm

Link to comment
Share on other sites

To test your calculation, try duplicating the calcuation field and make the result a number:

Case(PatternCount(ling_2, "CL") > 0,1,

PatternCount(ling_2, "DL-N") > 0,2,

PatternCount(ling_2, "DL-A") > 0,3,

PatternCount(ling_2, "DL-J") > 0,4,5)

See what number displays. I'm guessing here, that the calculation is working, but none of the case statements are true, so the "" is displayed. Can "ling_2" field contain more that one value? - if so, try reworking your calculation to trap false statements instead. If the "ling_2" field contains only a single value, try narrowing the cases:

Case(PatternCount(ling_2, "C") =1, cl_bar_image,

PatternCount(ling_2, "N") =1, dln_bar_image,

PatternCount(ling_2, "A") =1, dla_bar_image,

PatternCount(ling_2, "J") =1, dlj_bar_image, "")

Link to comment
Share on other sites

This topic is 7845 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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