Select to view content in your preferred language

Report Template - Filter Repeats Used in If Statement

631
3
01-23-2023 05:41 AM
AnthonyJonesRSK
Frequent Contributor

Hi,

Within the report template documentation here it suggests;

  • ${if (repeat1 | getValue:"count")>=3} displays the section only if repeat1 contains three or more records.

My question is whether it is possible to filter the repeat used in this if statement so I get a count for the number of repeats where a certain answer was given in a question in the repeat? I'd like to display a section of the report only if at least one repeat record has a particular answer in it.

I've tried various options here including where clauses documented here, so you have something like this;

${if (repeat1 | where:"weather='sunny'"| getValue:"count")>=3}

but this doesn't work (I assume it's limited to summary sections?) and no other options I've tried have worked. So I just want to know if this kind of filtering is possible and if so what is the syntax?

Any assistance would be much appreciated.

Thanks

Anthony

@IsmaelChivite @BarbaraWebster1 @Anonymous User 

 

3 Replies
StuartMoore
Frequent Contributor

did you ever get this to work, i am having the same issue

0 Kudos
Natalia
Emerging Contributor

Hi, 

I had a similar issue and got something working.

Within my survey repeat section {test_repeatA}, I have a selectone question called qnat_A, with Yes/No answer as filter. Then in my report I filter the repeat entries using, to get the photo I want:

${#test_repeatA| where:"qnat_A='Yes'"}

${#nat_photoA}

${/}

${/}

 

It doesn't count the entries but this works for me 🙂

Otherwise I have tried another workaround where I ask the surveyer to input the index of the suitable repeat, then I get this as a integer to use as filter in the report.

 

I hope this helps.

Nat

0 Kudos
SMH-Rio
Frequent Contributor

I have the same problem as you. Also struggling to get this to work 😪

0 Kudos