Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
Wade
Level I

How to search and add new column with formula (loop)

Hello,

 

I am trying to write a script for auto_calculation. I have one raw data table and one calculation table. The thing I want to do is to search the column name in the raw data table and then follow  the formula (expression) in calculation table to add new column in original raw table. The question now I am struggling is (1) How to search original raw data table (2) How to add the new column and determine the formula (3) The sequence is matter, need to follow the row sequence in calculation table since there are some new columns will use former new column.  Thank you all.Original raw data table and calculation tableOriginal raw data table and calculation tableThe new data table I want to generate by using scriptThe new data table I want to generate by using script

 

 

 

 

1 REPLY 1
Highlighted
uday_guntupalli
Level VIII

Re: How to search and add new column with formula (loop)

@Wade
             I have looked through what you are trying to achieve, In general, it might be easier to achieve what you want if your raw data table i.e. table 1 and calculation table i.e. table with formulae have a common column. If there is a common column or logic to follow, it would be easier to achieve what you are after. 

             Now, looking through the raw data if you want to use column names such as "Coffee" for reference, given the way the data you have shared is setup, you will need to customize for each column which may not be the most effective solution. 

 

            Is it possible for you to take a step back and provide a little more context around your data and what you want to achieve ? It may be easier to achieve ..

Best
Uday
Article Labels

    There are no labels assigned to this post.