We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How can I identify/highlight rows with values closest to zero?

yxt
7 - Meteor

Referencing  list of numbers below , I would like to highlight the 9 values closest to 0. If done manually, it would be -5,1,2,3, 4, 5, 6, 7, 8. What formula can I use as a row rule in basic table? I'm using basic table to highlight the background color for visibility. Thanks

 

-500

-200

-100

-50

-10

-5

0

1

2

3

4

5

6

7

8

 

7 REPLIES 7
LordNeilLord
15 - Aurora

Hey @yxt 

 

I think you would need to do some pre-work before the basic table to create a flag to say these are the rows you want to highlight

MichalM
Alteryx Alumni (Retired)

@LordNeilLord is correct.

 

I'd built something like the attached to identify the values I'm interested in and create a column with a flag. You can then use the flag to define the column rule

 

highlight-values.png

table-rule.pngcolumn-rule.png

 

danilang
19 - Altair
19 - Altair

Hi @yxt 

 

I have a few questions

 

Can you explain what you mean by "closest to zero"?  In your sample data -500 is not closer to 0 than any of the positive values, yet you include it in your list to flag.

Do you always require 9 values to be highlighted?

What if you have more than 9 negative numbers?

 

Dan

 

 

yxt
7 - Meteor

@danilangthanks for questioning. I've incorrectly phrased my question. Let me edit my post.

 

the 9 closes value to 0 would be -5, 1,2,3,4,5,6,7,8

yxt
7 - Meteor

Hi @MichalM . I've been pointed out that my post was incorrect. Otherwise it would be the perfect solution.

 

Corrected my post to mean : If done manually, it would be -5,1,2,3, 4, 5, 6, 7, 8.

MichalM
Alteryx Alumni (Retired)

In this case you only need to add one extra step to calculate an absolute difference between the 0 and value and sort these values by the difference. Updated sample attached

 

diff-zero.png

 

ABS(0-[Values])

 

 

yxt
7 - Meteor

this was such a straightforward solution. thank you so much!

Labels
Top Solution Authors