Reading in a reference table to perform an analysis on a data set and output csv files

Reply
Contributor
Posts: 23

Reading in a reference table to perform an analysis on a data set and output csv files

I have a reference table that displays how my industries are grouped into sectors , and what has to go in each of the charts. The reference table looks as such:

ClusterSectorIndustry1Code1industry2code2Table_num_per_sectorchart_title
RWCP  Pharmacy Sales 61241test1
AAGAg nfd010  4test8
AAGMush012  4test8
AAGFruit013  4test8

 

I want to reference this table and output csv files. The data set I will perform the analysis on is this: 

 

codeyearindustryemp
0102008Ag nfd1
0102009Ag nfd2
42008B2
42009B2
0122008Mush1
0122009Mush2
0132009Fruit3
61242008Pharmacy Sales 2
61242009Pharmacy Sales 4

 

I want to use the reference table to go through this data set and output csv files like this (for example).

 

CSV1: Called test1

 

yearPharmacy Sales
20082
20094

 

CSV2: called test8

yearAg nfdMushFruit
2008110
2009223

 

It is important to note how the outputed csv's are called what they are told to from the reference table, and that missing values such as 2009 for Fruit are given a value of 0. Code1,Code 2 and industry1,industry2  in the reference table are to be compared with code and industry in the dataset that will be analysed.

 

I am wandering how to go about doing this. As I am working on a data set similar to this but on a bigger scale.

Super User
Posts: 13,583

Re: Reading in a reference table to perform an analysis on a data set and output csv files

You might need to supply a little more detail on exactly HOW your reference table is used. Since the "analysis" you show is different then that tells me that the rows of the reference are used differently. Without a clue as to what may be wanted how to use your reference table is not obvious.

 

Call execute can be used with a data set to conditionally generate code, if you know which code you want. If you do not know which code you want then that is an entirely different set of questions.

 

We would need to know the purpose and possibly more values for each of the variables in the reference data set and then the type of "analysis" for each csv, especially if it is anything more than selecting records from the data set.

Ask a Question
Discussion stats
  • 1 reply
  • 102 views
  • 0 likes
  • 2 in conversation