community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Designer Knowledge Base

Definitive answers from Designer experts.

Adding Comments to Expressions

Creative Director
Creative Director
Created on

Question

Is it possible to add a comment to an expression used in a Filter or Formula?

Answer

Yes, once you have a valid expression, just use // followed by your comment on the next line.
comment.PNG

Comments
Alteryx Certified Partner
Alteryx Certified Partner

/* you can also

add blocks of comments

into the formula */

 

i use use this technique when I comment out old code in place of new code. 

 

 

Asteroid

That is very useful. Thank you!

Asteroid

Thanks for posting this.  I will be using this in documenting and testing workflows.

Meteoroid

You don't need to go to the next line.

 

You thus have 2 ways:

- comment in line with // : anything after this on this line is commented

      you can use it to place in comment a full line or comment at the end of a line

 

- comment by block with /* your comment */ : anything in between this is commented, whether it's on the same line or not.

     you can use it to comment several lines at a time, or just a portion of a line (in that case, be careful about content in quotes, plus it's not very readable)

 

Illustration

Capture3.PNG