Calcite | Level 5

## use row count as X axis values

I have a columns of positive and negative values with high cardinality that are captured in sequence of one another. I would like to build a step plot the actual value (ex. 0.549, -2.9583, 0.624, -0.563) along the y axis, but have them distributed across the X axis, using the row-count as a proxy for a unit of time (I actually have many columns of this kind of data, and the numbers are captured sequentially). Is there a way to do this only the tools that exist in the SAS Visual Analytics tool?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: use row count as X axis values

General SAS plotting requires the variables to have the values beforehand. Exceptions are statistical procedures that make plots based on requested analysis.

So one you have the "order" variable added the data should be easy to plot as you just tell the tools which axis to use which value and the type of plot.

I don't have access to Visual Analytics, so I can't say what the transform has to be.

Your ordered pairs are written incorrectly. The X value comes first, with the Y second. If the X is supposed to be 1 then the pair should be written as (1, 0.549) . If you think in different order the plots are going to come out a bit strange, if the tools even allow them.

4 REPLIES 4
Super User

## Re: use row count as X axis values

Are you actually asking how to add a "row count" to your data? You may need to provide an actual example of your data as the methods for adding such a "count" can be pretty data dependent.

Calcite | Level 5

## Re: use row count as X axis values

I'd prefer to not add another column if possible, but if that is a simpler means of getting what I'm after, I'd be fine with it. However, I'm not sure how to provide an example other than the following:

for example:

row 1: 0.549
row 2: -2.9583
row 3: 0.624
row 4: -0.563

I want the four plotted data points to be (0.549, 1), (-2.9583, 2), (0.624, 3), (-0.563, 4).

visual representation: https://octave.sourceforge.io/octave/function/images/stairs_501.png

Again, if I must make a new column to capture the row counts, so I can use them as x-axis values, then that's fine. My primary question is: can this be done WITHIN the Visual Analytics tool or if I would have to swap to the Data Studio and use SAS code?
Super User

## Re: use row count as X axis values

General SAS plotting requires the variables to have the values beforehand. Exceptions are statistical procedures that make plots based on requested analysis.

So one you have the "order" variable added the data should be easy to plot as you just tell the tools which axis to use which value and the type of plot.

I don't have access to Visual Analytics, so I can't say what the transform has to be.

Your ordered pairs are written incorrectly. The X value comes first, with the Y second. If the X is supposed to be 1 then the pair should be written as (1, 0.549) . If you think in different order the plots are going to come out a bit strange, if the tools even allow them.

Calcite | Level 5

## Re: use row count as X axis values

Yep, they definitely are. that was just an oversight and I can't see a way to edit a reply ha.

Okay, thank you for that info. Unfortunately, I can't create any calculated columns at the moment due to an environment issue, so I will just have to get that resolved before I can continue my work.