Hide Null or 0 values in table

307
2
Jump to solution
02-22-2024 06:07 AM
dwold
by
Occasional Contributor II

I want to remove/hide records that have Null or 0 in a table. I'd like the Gap Percent column to start with the Gap Percent record that has 5. @KenBuja I saw a thread on doing this in pop-ups that I tried to follow but having some issues getting it to work in a table.

dwold_2-1708609743393.png

dwold_3-1708609769834.png

I tried something like this, and it removes the Null values but not the 0 values as well:

var gap = IIf(IsEmpty($datapoint.gap_percent), "0", $datapoint.gap_percent)

return {
  cells: {
    target_value_final: {
      displayText : $datapoint.target_value_final,
      textColor: '',
      backgroundColor: '',
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    gap_percent: {
      displayText : gap,
      textColor: '',
      backgroundColor: '',
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    }
  }
}

 

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

IsEmpty returns true if a field either has a null value or an empty string (''). You'll have to check separately for the 0 value, since that is not null.

var gap = IIf(IsEmpty($datapoint.gap_percent) || $datapoint.gap_percent == 0, "0", $datapoint.gap_percent)

 

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

IsEmpty returns true if a field either has a null value or an empty string (''). You'll have to check separately for the 0 value, since that is not null.

var gap = IIf(IsEmpty($datapoint.gap_percent) || $datapoint.gap_percent == 0, "0", $datapoint.gap_percent)

 

dwold
by
Occasional Contributor II

@KenBuja thank you!!!

0 Kudos