Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

_CurrentField_ pointing to a different column

Arvinchester
6 - Meteoroid

I am creating a conditional formatting for each new month (numeric column) using the Dynamic or Unknown Fields in the Table tool.

 

([Limit_Min_Max]='max' &&
[_CurrentField_]>=[Limit_Number]*0.9 &&
[_CurrentField_]<=[Limit_Number])

OR

([Limit_Min_Max]='min' and
[_CurrentField_]<=[Limit_Number]*0.9 &&
[_CurrentField_]>=[Limit_Number])

 

I'm getting the following error:

Invalid type in operator >.

 

When I added the function ToNumber([_CurrentField_]), I found out that it is pointing to a different column that is a string datatype ([Warehouse]).

 

How can I make sure that the [_CurrentField_] is actually pointing to the actual current field?

7 REPLIES 7
Qiu
21 - Polaris
21 - Polaris

@Arvinchester 
I did a simple test on my end and it seems just working.

I am sorry to ask but are you sure that the field is numeric? The error indicates your field type is not numeric.

And one more, I think your conditional Statement should be as below.


 

([Limit_Min_Max]='max' &&
[_CurrentField_]>=[Limit_Number]*0.9 &&
[_CurrentField_]<=[Limit_Number])

OR

([Limit_Min_Max]='min' and (
[_CurrentField_]<=[Limit_Number]*0.9 or
[_CurrentField_]>=[Limit_Number]))


1011-Arvinchester.png

Arvinchester
6 - Meteoroid

I've attached the select tool. The values of the _CurrentField_ is coming from the [Warehouse] column.

For example, [Oct-2023] is the new column and inherits the formula from 'Dynamic or Unknown Fields', then it will throw that error.

If I replace the [_CurrentField_] with [Oct-2023] in the formula, then it will not throw an error.

 

Thanks for correcting the formula as it will not result correctly. Here is the modified formula.

 

([Limit_Min_Max]='max' &&
[_CurrentField_]>=[Limit_Number]*0.9 &&
[_CurrentField_]<=[Limit_Number])

OR

([Limit_Min_Max]='min' && 
[_CurrentField_]<=[Limit_Number]*1.1 &&
[_CurrentField_]>=[Limit_Number])

Arvinchester
6 - Meteoroid

Attached is a sample workflow. The [_CurrentField_] is definitely not referring to the current field but to another column.

caltang
17 - Castor
17 - Castor

Is the data type correct for > or < comparisons? If it's not numeric in nature then you need to change it.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Qiu
21 - Polaris
21 - Polaris

@Arvinchester 
I can now identify what is causing the error, but can not know the logic.

So whatever comes from upstream of data, we can not deselect any column otherwise, it will throw an error.

In your workflow, SheetName was deselected, so it had error.

After I select the Sheeet Name column, then it was just ok.

Maybe a bug?

Reporting_r1.PNG

Arvinchester
6 - Meteoroid

Thank you Qiu. Indeed, the [_CurrentField_] is quite sensitive when there are columns that are deselected in the Table tool, especially if they are at the top of the list. I removed the [SheetName] from the previous select and then moved [Limit_Number] and [Limit_Min_Max] to the end of the list. I deselected both columns and had no problems. I tried adding one more 'deselected' column and [_CurrentField_] went off again so I removed it.

Qiu
21 - Polaris
21 - Polaris

@Arvinchester 
Thank you for the feedback.
I still can not figure out what is the logic behind. 😁

Labels