Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Ugly calc need help!


LaRetta

Recommended Posts

Hi Cafe'

 

I have a calc ... pleast don't ask why ... it's the only way I could accomplish the task at hand.

 

Purpose of calc: Display all field names (and only those field names) which have a value of Y (32 fields total) into a list.

 

Now, it's been decided that we only want to show 15 of the options - but the top 15 as listed in the calc. I can drop off the calc line after the 15th entry, but that would potentially mean that less items would list ... and we always wants 15 if 15 or more options are 'y'. We need a maximum of 15, because of the space on a pre-printed form.

 

Calc is:

 

LeftWords(

Case(Table , "Table¶") &

Case(Chair, "Chair¶") &

Case(Sofa, "Sofa¶") &

etc ... and ending with:

"Ask your Sales person for full details")

, 999)

 

And client always wants the last line "Ask your sales person for details" to always print no matter what. So, conditionally, 14 max options plus last line.

 

Any thoughts? Other than dump the structure? I'm working on it! This is a temp fix until we restructure.

 

I suppose I could use a second conditional display calc or something but it's pretty messy either way. :eek:

 

LaRetta

Link to comment
Share on other sites

The only thing I could think of was the second calc you mentioned. Here is the code for that calc ("big_calc_field" refers to the calc you listed above):

 

Left(

big_calc_field,

 

If(

PatternCount( big_calc_field, "¶")

 

Position( big_calc_field, "¶", 0, PatternCount( big_calc_field, "¶") ),

Position( big_calc_field, "¶", 0, 14 )

)

) & "Ask your Sales person for full details"

Link to comment
Share on other sites

Hi Mariano!

 

That worked perfectly ... thank you so much!! laugh.giflaugh.gif

 

And thanks for not asking why I have such an ugly thing in a dB! :rolleyes:

 

LaRetta

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use