Use the Use

Do you use the USE syntax function in WinCross? It is one of my favorite things, and I KNOW I “use” it the most.

What USE does is allow you to “borrow” syntax logic from a previous question. You can make minor changes by assigning new variables or new values to the Rows or changing the filter (or all three!)

How is this helpful? When you have a matrix question with several attributes yet the values are all the same, you can create one table, and then with USE, quickly create subsequent tables.

In order for the USE to work, you will need an index number. This happens automatically when you create your table in the Add Tables section. If you coded the origin table by hand you can make up your own index (as long as it is unique) OR you can save your job and re-open it; WinCross will magically populate any missing index numbers.

The syntax of the USE function always starts with the word, in all caps: USE. This is followed by the equals sign, and then the index.

If you were making another table that only changed the filter, the USE would look like this:

USE=2354

If you want to change a variable, you would add that after index number, like so:

USE=2354,VARIABLE1=VAR7

If you want to change a value, you would add that logic aftger the index number:

USE=2354,(1)=(5)

You could do more than one action in a use, changing variable(s) AND value(s)

USE=2354,VAR6=VAR8,VAR7=VAR9,(6)=(3),(7)=(2)

Where is the index number? The index number is located in the top of the table, right after the ^ sign. It is always a number.

As you can see, in the table below, the index number is 789:

TVar1^789
 OW,ST,And Other Global (for the table) Row/Table Options here
 This is where the title goes
SAttribute 1 – This is the subtitle
 Total Respondents^TN^0
 First Row in table^VAR1 (1)^
 Second Row in Table^VAR1 (2)^
 Third Row in Table^VAR1 (3)^

Let’s say you want to add tables for three more attributes with different variables. You’d simply copy and paste the first few rows, and add the USE function, like this:

TVar2^
 OW,ST,And Other Global (for the table) Row/Table Options here
 This is where the title goes
SAttribute 2
 Total Respondents^TN^0
USE=789,VAR1=VAR2
TVar3^
 OW,ST,And Other Global (for the table) Row/Table Options here
 This is where the title goes
SAttribute 3
 Total Respondents^TN^0
USE=789,VAR1=VAR3
TVar4^
 OW,ST,And Other Global (for the table) Row/Table Options here
 This is where the title goes
SAttribute 4
 Total Respondents^TN^0
USE=789,VAR1=VAR4

Notice that all I did was change the subtitle and variable names, now when the table is run, it will point to the variable in the USE function line. If I wanted to change the values in the rows, like if I wanted to change the First Row in Table from value (1) to value (5), all I would need to do is add ,(1)=(5) to the use line.

Pitfalls

Of course, with anything, there are pitfalls. The obvious is copy/paste errors. That is why, when I create table syntax for a matrix with several attributes, I use a home-made Java program to generate the syntax.

Another pitfall is that if you have the wrong index (or variable/value assignments) your tables will not have the correct data. [This is why it is nice to have someone check over your tables when you are done programming them, if you have the luxury.]

The last pitfall is more like an annoyance, with the new version of WinCross (#14), WinCross is no longer allowing duplicate indexes=0. Previously WinCross allowed duplicate indexes=0, because when you re-opened the job file, it would automatically assign a proper index number for it. Now, if you are playing around with the tables, you can inadvertently make your blank indexes turn to 0s. This is fine if it only happens to one table; problematic for more than one in that the tables will not run!

Do you use the USE? What do you think about it?

  • The Analytical Group

    Thanks for the informative post. In case it helps, note that while editing in the job file you can select the “Reindex” command from the (right-click) context menu. This will reindex all the tables in the job file, taking care to update any index numbers that appear in USE statements or “RT” ranking options.

    • lannalee

      This is fantastic. Thanks for the update!

  • The Analytical Group

    It’s also worth mentioning that–starting with WinCross 14–a USE statement can reference a table name rather than a table index. So if you’ve created a table called “LikeScale” you can reference it later on with a USE statement such as “USE=LikeScale,VAR1=Q1″. This is easier (for most people) than remembering that, say, table index 34 is the table with the Like scale.

    • Scott Segrin

      This is a great add and makes the USE statement much more…

      (wait for it…)

      USABLE.

      • lannalee

        Ha!