This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
on 03-24-201603:06 PM - edited on 02-27-202002:23 PM by KylieF
Do you pull in demographic variables from the Allocate toolset and then use a formula tool for some basic math functions on those variables? Summing them together for example? Instead of having to pull these variables and process them in a formula tool in each of your workflows, you can create custom variables for your use that already have these basic mathematic functions so all you will have to do is select that variable in the Allocate tools.
To do this you will have to set up your custom variable in one of Alteryx’s older software platform’s that is still installed with the designer. The Allocate platform is what you will use and most of its functionality has been adopted into the Designer.
The easiest way to find the Allocate program is to search “Allocate” in your start menu’s search bar:
In Allocate, you will want to make sure your Workspace is set to the correct database for the variables you want to have access to in order to create your custom variable. If you do not have any dataset available, you can download and install the 2010 Census data for free here - http://downloads.alteryx.com/data.html.
Once your desired dataset is selected, you will then go to the Variables tab click file and select Add Virtual Variable.
The next window that pops up will be the Create Formula window. This is where you can make your variable selection and mathematic function to be performed on the selected variables. This example is going to be using just a basic addition function to get the sum of two variables, but you can see all of the options available to you under the Operators and Functions tabs of the Create Formula window.
For this example I am just going to add Total Female population to Total Male population. Those variables can be found under the Population folder and then in the US Census (2010) folder. Once you have selected the variables and created your mathematic function your expression should look like the following: [P0120026]+[P0120002]. [P0120026] is the variable name for Total Female population and [P0120002] is the variable name for Total Male population. Once your function is complete you can click Next.
The Variable Properties window will be the next thing you see and here is where you can start the naming of your custom variable. The Name text box is where you can populate the variable name that you will see when your variable is output from either Allocate or tools in the Designer. Description is where you can put information on how the custom variable was calculated; by default it will bring your function over from the previous window. Keep in mind that this is also the naming convention you will see when looking at the variable tree structure in Allocate or the Designer. Based on your function you can also choose the type of unit you would like your variable to be displayed.
Lastly on this menu you will have to choose a save location. This is also not required, but if you do opt to save a variable, a Virtual Variable File (.vvf) will be added permanently and may be shared amongst other users. In the Save Variables box, Click the New button and choose a name for your .vvf (file name and internal). The file name will be the one you would look for to send to someone else, or to remove. The internal name should be recognizable so that you can add additional variables to this file if you want to. You can then hit OK to save and Next on the Variable Properties window.
The next window you will see is the Variable Hierarchy and this is where you choose where your variable will reside in the tree hierarchy of existing variables. For my example I have created a New Category called CustomVariables, within that new category I made a New Vintage of CustomVariablesQ1 2016, and within that new vintage I created a new Subcategory of CustomPopulationVariables. The custom variable that you are created will be loaded into the new Caterogy/Vintage/Subcategory that you have highlighted when you click Finish.
Once finished, you now have your new custom variable available for use in Allocate and the Designer!