Select to view content in your preferred language

Hide Report Section Based on Two Separate Repeat counts

169
2
3 weeks ago
icf_Eric_Link
Regular Contributor

Hello,

I have a report that has two repeats per section.  If there are no records in either of the repeats feeding the section I would like to hide the section and add place holder text that says "No observed species."  The issue I am running into is that one repeat may have a record while the other does not.  In that case I would only show the one repeat that has the record.  Here is my current logic.

NPCS Species Present: ${if (NPSCSpPresent_1 && NPSCSpPresent_2 | getValue:"count")==0}No observed species.${/}

${if (NPSCSpPresent_1 || NPSCSpPresent_2 | getValue:"count")>0}

${#NPSCSpPresent_1}

${NPSCSp_1}

${/}

${#NPSCSpPresent_2}

${NPSCSp_2}

${OtherNPSC}

${/}

 

 

 

NPCS Dominant Species:

 

${SpDomList_3| appearance:"multiline"}

 

NPCS Notes:

 

${NPCSNote_3| appearance:"multiline"}

 

${/}

 

Currently the logic fails to show any questions from either of the repeats.  Any ideas on how to hide a section in a report based on if one of the repeats has a record?  

Thanks to all that respond.

0 Kudos
2 Replies
abureaux
MVP Frequent Contributor

You already have most of the logic there.

Have you tried something like this yet?

${if (rep1 | getValue:"count")==0 && (rep2 | getValue:"count")==0}No observed species.${/}${if (rep1 | getValue:"count")>0 && (rep2 | getValue:"count")==0}rep1.${/}${if (rep1 | getValue:"count")==0 && (rep2 | getValue:"count")>0}rep2.${/}${if (rep1 | getValue:"count")>0 && (rep2 | getValue:"count")>0}rep1 + rep2.${/}

0 Kudos
abureaux
MVP Frequent Contributor

And in case it isn't immediately obvious, I:

  1. Isolated both repeats to grab their own counts. This allows you fine control over logic.
  2. Set up four logic paths for every possibility: Rpt1==0 and Rpt2==0; Rpt1>0 and Rpt2==0; Rpt1==0 and Rpt2>0; Rpt1>0 and Rpt2>0

You can put what you need where you need it.

You can also drop logic paths if they aren't needed (e.g., you most likely don't need the Rpt1>0 and Rpt2>0 option).

0 Kudos