-
Dear all,
Is there an easy way to extract the odd/even row from a column? For example, I usually have the Peak/Valley data, i.e., the odd row is the valley value, and the even row is the peak value. However, I constantly need to plot the peak value or the valley value. Now I am using excel to separate the peak and valley values into different columns, then paste into Datagraph. I am just wondering is there a better way to do the trick in Datagraph? That will save me a lot of time. Thanks all.
Sounds like you want something like this, where we made up some random data, then created a column that separates the odd and even values.
The Odd and Even numbers are created using an Expression column. The expression uses the built-in row counter ‘#’ and you specify the number of rows.
Another expression column is used to pull the values using the column name followed by the index in parentheses.
You could also do it in one step, such as “Data(#*2-1)” and “Data(#*2)” and use a variable for the column length if that changes all the time.
Does that help?
I guess I took the request another way. It sounded like for every data point, there were two values.
The method I chose was to mask the data with a if statement that checks the reminder of a number divided by 2. This separates the peaks and troughs, and then you can plot them individually.
Jordan – Good suggestion! Your approach has the benefit of maintaining the data in the same row, which could be helpful to verify everything is working correctly and keep the data tied to any other columns of data you may have.
Thank you Jordan, this is a fancy way to do the trick. Thank you very much.
You must be logged in to reply to this topic.