Skip to main content
Participant
December 4, 2023
Question

Report Script to If/Else to exclude rows without a match

  • December 4, 2023
  • 3 replies
  • 561 views

This is a report script which assigns a letter but if it's not 1, 2 or 3 it currenlty puts a ?.  How can I just exclude the rows that aren't 1, 2 or 3?

 

if (Event.Value == 1)
                                    Event.Value = 'A'; 
                                else if (Event.Value == 2) 
                                    Event.Value = 'C'; 
                                else if (Event.Value == 3) 
                                    Event.Value = 'D'; 
                                else 
                                    Event.Value = '?';
This topic has been closed for replies.

3 replies

JR Boulay
Community Expert
Community Expert
December 5, 2023

Try this:

 

if (event.value == 1) {event.value = "A";}
else if (event.value == 2) {event.value = "C";}
else if (event.value == 3) {event.value = "D";}
else {event.value = "";}
Acrobate du PDF, InDesigner et Photoshopographe
Bernd Alheit
Community Expert
Community Expert
December 4, 2023

Check the JavaScript console for errors (ctrl-j).

Bernd Alheit
Community Expert
Community Expert
December 4, 2023

This script will not work.

Replace

 Event.Value

with

 event.value

 

Participant
December 4, 2023

It works, it's just that I don't want the rows to show if it's not an A, C or D.