alteryx Community

# Alteryx for Excel Users: Create a bar chart in a column

Alteryx
Created

There's a nifty little trick in Excel using the =REPT function that creates an in-cell bar chart. Let's start with a simple set of numerical data:

Using the expression:

produces an in-cell chart that looks like this if you change the B2:B4 to a Wingdings font:

I divided the numerical data in A2:A4 by 5 to avoid getting a chart that was too big. Alternatively, we can use the expression:

And used an 8-pt Arial font to produce a bar chart without dividing Qty.

Neat-o! I wonder how I can do this using Alteryx.

To make a chart that looks like the one with the Wingdings font above, we'll have to refer to a unicode character table. We can't change the font to Wingdings, so we'll have to find the '■' character in the unicode character table. We have to scroll WAY DOWN to find it (it's Unicode number U+25A0).

Let's bring in our data using a Text Input Tool:

and connect a Formula Tool followed by a Browse:

Where the formula expression uses the function PADLEFT:

Our result looks like the one from Excel:

Of course, we didn't have use a Unicode character. We could have used '|', similar the Excel example using the 8-pt Arial font.

Let's elaborate on this a bit. In our example, we would like to have a quick visual that stands out if [Qty] < 60. In the Formula tool expression, we'll use a conditional statement so a quantity less than 60 will appear as '▣' (U+25A3):

The results look like this:

Let's take one final we could create a visual, one where the chart only has a single '■' positioned relatively. In other words, '■' for a quantity of 100 would appear further to the right than the row with a quantity of 55.

This gives a chart column that looks like this:

No ratings