Creating a maintenance summary note from calculated field

543
1
Jump to solution
04-21-2020 12:52 PM
BryanO_Reilly
New Contributor III

Hello,

I'm trying to create a detailed and formatted maintenance summary dynamically from user input. So far, I have got the function to work, but it will only take the first TRUE if statement. Ideally, everything with a rating > 1 would be appended to the "Maintenance Summary" with the format shown below (Name: {Rating} 'new line indented' Comment: {Comment}). I'm doing this using one hidden field for the calculation (type: calculate) and one field for the Maintenance Summary (type: note; label: <font color = "red"><b><center>Maintenance Summary</center></b></font><p>${Maintenance_Calc})

the calculation in the calculated field is as follows (only for two fields at the moment for testing; it will be used on around 200 fields if I can get it to work..)

if(${IB_IZ_IO_Rat}>1,'<b>Inlet Zone - Inlet obstruction: </b>' + ${IB_IZ_IO_Rat} + '<blockquote><u>Comment:</u> ' + ${IB_IZ_IO_Comm} + '</blockquote>','') or if(${IB_IZ_EBSS_Rat}>1,'<b>Inlet Zone - Erosion, bare spots, & sedimentation: </b>' + ${IB_IZ_EBSS_Rat} + '<blockquote><u>Comment:</u> ' + ${IB_IZ_EBSS_Comm} + '</blockquote>','')

Any and all help is greatly appreciated!!!

0 Kudos
1 Solution

Accepted Solutions
BryanO_Reilly
New Contributor III

I got it to work as I intended. 

Modified Calculation Code below. The Key was to make them self contained if statements and use the "+" symbol to combine them.

if(${IB_IZ_IO_Rat}>1,'<b>Inlet Zone - Inlet obstruction: </b>' + ${IB_IZ_IO_Rat} + '<blockquote><i>Comment:</i> ' + ${IB_IZ_IO_Comm} + '</blockquote><p>','') + if(${IB_IZ_EBSS_Rat}>1,'<b>Inlet Zone - Erosion, bare spots, & sedimentation: </b>' + ${IB_IZ_EBSS_Rat} + '<blockquote><i>Comment:</i> ' + ${IB_IZ_EBSS_Comm} + '</blockquote><p>','') +if(${IB_IZ_PT_Rat}>1,'<b>Inlet Zone - Pretreatment: </b>' + ${IB_IZ_PT_Rat} + '<blockquote><i>Comment:</i> ' + ${IB_IZ_PT_Comm} + '</blockquote><p>','') +if(${IB_IZ_SI_Rat}>1,'<b>Inlet Zone - Structural Integrity: </b>' + ${IB_IZ_SI_Rat} + '<blockquote><i>Comment:</i> ' + ${IB_IZ_SI_Comm} + '</blockquote><p>','') +if(${IB_PZ_SA_Rat}>1,'<b>Perimeter Zone - Surface area: </b>' + ${IB_PZ_SA_Rat} + '<blockquote><i>Comment:</i> ' + ${IB_PZ_SA_Comm} + '</blockquote><p>','') +if(${IB_PZ_SSE_Rat}>1,'<b>Perimeter Zone - Side slope erosion: </b>' + ${IB_PZ_SSE_Rat} + '<blockquote><i>Comment:</i> ' + ${IB_PZ_SSE_Comm} + '</blockquote><p>','')

View solution in original post

0 Kudos
1 Reply
BryanO_Reilly
New Contributor III

I got it to work as I intended. 

Modified Calculation Code below. The Key was to make them self contained if statements and use the "+" symbol to combine them.

if(${IB_IZ_IO_Rat}>1,'<b>Inlet Zone - Inlet obstruction: </b>' + ${IB_IZ_IO_Rat} + '<blockquote><i>Comment:</i> ' + ${IB_IZ_IO_Comm} + '</blockquote><p>','') + if(${IB_IZ_EBSS_Rat}>1,'<b>Inlet Zone - Erosion, bare spots, & sedimentation: </b>' + ${IB_IZ_EBSS_Rat} + '<blockquote><i>Comment:</i> ' + ${IB_IZ_EBSS_Comm} + '</blockquote><p>','') +if(${IB_IZ_PT_Rat}>1,'<b>Inlet Zone - Pretreatment: </b>' + ${IB_IZ_PT_Rat} + '<blockquote><i>Comment:</i> ' + ${IB_IZ_PT_Comm} + '</blockquote><p>','') +if(${IB_IZ_SI_Rat}>1,'<b>Inlet Zone - Structural Integrity: </b>' + ${IB_IZ_SI_Rat} + '<blockquote><i>Comment:</i> ' + ${IB_IZ_SI_Comm} + '</blockquote><p>','') +if(${IB_PZ_SA_Rat}>1,'<b>Perimeter Zone - Surface area: </b>' + ${IB_PZ_SA_Rat} + '<blockquote><i>Comment:</i> ' + ${IB_PZ_SA_Comm} + '</blockquote><p>','') +if(${IB_PZ_SSE_Rat}>1,'<b>Perimeter Zone - Side slope erosion: </b>' + ${IB_PZ_SSE_Rat} + '<blockquote><i>Comment:</i> ' + ${IB_PZ_SSE_Comm} + '</blockquote><p>','')

0 Kudos