Author |
Topic |
|
zknauss
USA
72 Posts |
Posted - 01/24/2023 : 11:29:42 AM
|
Good afternoon, I have the below script which I'm using to sort data based on pattern of change. Currently its operating how I intended but instead of outputting letters I'd like it to output Arrows representing the direction of change specifically what I'd like to have it output is below:
A = up arrow, color (red), shortcut key code: 2191 B = horrizontal bar, color (black), code: 2015 C = down arrow, color (blue), code: 2193
Thanks in advance for any help with this
for (int i = 1; i <= wks.ncols; i++ ){ range aa = [NCONFreReg]"Frequency_T1"!$(i+1); range bb = [NCONFreReg]"Frequency_T2"!$(i+1); %j=wcol(i)[1]$; wcol(i)[2]$ =
if(bb[1]>0.01&&bb[1]>=aa[1]&&bb[2]<=aa,"A",
if(bb[1]>0.01&&bb[1]>=aa[1]&&aa==0&&bb[2]!=0,"A",
if(bb[1]>0.01&&bb[2]>aa && bb[2]<aa[9] && %j!="B","B",
if(bb[1]>0.01&&bb[1]<aa[1] && bb[2]>aa[9] && %j!="B","C","I")$)$)$)$; }
ZTK |
|
YimingChen
1629 Posts |
|
zknauss
USA
72 Posts |
Posted - 01/24/2023 : 2:34:45 PM
|
I'm not sure how I'd impliment that in the for/if statment or pull other symbols such as a horizontal bar.
ZTK |
|
|
YimingChen
1629 Posts |
Posted - 01/24/2023 : 3:33:44 PM
|
It works to include unicode symbols in the script. See below:
|
Edited by - YimingChen on 01/24/2023 3:37:19 PM |
|
|
zknauss
USA
72 Posts |
Posted - 01/24/2023 : 3:52:59 PM
|
I'll give it a try in my script would the " " be nessasary for this to work? I tried using, col(1)[1]="↑"; and col(1)[1]=↑; but got a error message or an output of -- in the designated cell.
ZTK |
|
|
zknauss
USA
72 Posts |
Posted - 01/24/2023 : 4:00:55 PM
|
Also is there a way to set the color of the arrow/symbol created? Thanks!
ZTK |
|
|
YimingChen
1629 Posts |
Posted - 01/24/2023 : 5:30:45 PM
|
1. You are missing the dollar sign. Try: col(1)[1]$=↑ 2. set font color: wcellcolor type:=1 irng:=col(B) color:=2 |
Edited by - YimingChen on 01/24/2023 5:31:01 PM |
|
|
|
Topic |
|