Macro Question: Get Column Name by Column Number / or Use Text constant to link on a

J

JoachimJaeger

#1
Hello ,

I'm an engineer with the responsibility to look onto some production test data.
I'm using minitab to generate a lot of e.g. cpk plots based on production data.

The data is located in a worksheet with unique column names as below:

Counter SerialNo Operator DateTime PassFail StationID Size1 Size2 Color1 Color2 Size3 [....]
100 ABCD OP1 2014-10-20 15:17 P Station1 3000 2789 blue green 2700 [....]
101 ABCE OP1 2014-10-20 15:27 P Station1 3003 2799 blue red 2710 [....]
[...]

To generate the plots I'm using a global macro to do this.
The macro looks similar to this example:

Capa 'Size1' 1;
Lspec 2950;
Uspec 3050;
[... sub commands not mentioned her to save space]
CStat.
Capa 'Size3' 1;
Lspec 2550;
Uspec 3150;
[... sub commands not mentioned her to save space]
CStat.
[...]

The macro itself is working fine, but it is not easy to maintain. Especially if a test limit was changed or an additional test step has to be added or removed.

To improve the script I added some additional columns with following content as a lookup table
TestStep LimitLow LimitHigh
Size1 2950 3050
Size3 2550 3150

My idea was to to run a loop to all the test steps as stored in the table and use the values of the table as input.
I was able setup a loop as follows:
let k1= count('TestStep') # get the no of test steps
do k2 = 1: k1
Let k100 = TestStep[k2] # get TestStepName
Let k101 = LimitLow[k2] # get LSL
Let k102 = LimitHigh[k2] # get USL


When I now try to generate the capa as
Capa k100 1;
[...]

I got an error massage that a column was required.
Is there any possibility to use a text constant as an input for a graph e.g capa or hist?

I tried also to use a numeric input variable to generate multiple capas.
do k1 = 1: 10
Capa ck1 1;
[...]

This seems to be working. The problem is that it is not necessary to generate the plots for all of the stored data.
Due to this I considered to expand my lookup table with the column information.
TestStep LimitLow LimitHigh InColumn
Size1 2950 3050 7
Size3 2550 3150 11

Now I can use following macro:
let k1= count('TestStep') # get the no of test steps
do k2 = 1: k1
Let k100 = TestStep[k2] # get TestStepName
Let k101 = LimitLow[k2] # get LSL
Let k102 = LimitHigh[k2] # get USL
Let k103 = InColumn[k2] # get ColumnNo
Capa ck103 1;

This is my Idea for the moment. But currently I'm fighting to get the column number based on the column name. I thought about to run a loop over all used columns and compare the column name to the string in the lookup table and store the number if they fit.
My problem is that I could not find any function to get the column name by the column number.
Is there existing such functionality?
All other ideas are also welcome.

Thanks a lot
Joachim
 
Elsmar Forum Sponsor

Stijloor

Leader
Super Moderator
#2
Re: Macro Question: Get Column Name by Column Number / or Use Text constant to link o

A Quick Bump!

Can someone help?

Thank you very much!!
 
Thread starter Similar threads Forum Replies Date
V Minitab GRR crossed Xbar and r method macro needed Using Minitab Software 9
Q QI Macro Histogram - Can someone define *sorted data*? Capability, Accuracy and Stability - Processes, Machines, etc. 7
D minitab macro to pull access query with parameters Using Minitab Software 1
V Validation of macro - scripts - programs used in statistical software (Minitab-SAS... Qualification and Validation (including 21 CFR Part 11) 5
F Run Minitab Macro from Excel Using Minitab Software 3
M Minitab macro to add reference line to graph Using Minitab Software 1
M Writing a Minitab macro that can manipulate data in all columns Using Minitab Software 3
L Webcam with Macro Capability for Skype between our facility and a satellite location Inspection, Prints (Drawings), Testing, Sampling and Related Topics 2
B Macro Process Mapping (pre-GAP analysis) ISO 9000, ISO 9001, and ISO 9004 Quality Management Systems Standards 3
B Using a File Name as a Variable in an Excel Macro Excel .xls Spreadsheet Templates and Tools 11
J Excel Macros - "Button" on a form that executes a macro Excel .xls Spreadsheet Templates and Tools 8
M Insert Empty Column Using Minitab Macro Using Minitab Software 2
B Wheeler Honest Gauge R&R macro wanted Excel .xls Spreadsheet Templates and Tools 2
B Minitab R14 macro for Power Analysis Using Minitab Software 1
T Minitab - Getting a Minitab Macro to look up a Column Name Using Minitab Software 23
M Minitab Macro-Command 'NUMERIC' to convert a text column to an numeric column Using Minitab Software 8
M Minitab 15 - READ, SET from keyboard or file doesn't work in my macro Using Minitab Software 4
A Process Mapping - for "Audits" - Detailed process map + macro map + FMEA Process Maps, Process Mapping and Turtle Diagrams 10
M Macro to fill up columns when shorter then others Using Minitab Software 4
J RANCOVA (rank ANCOVA) macro for minitab Using Minitab Software 2
M Problem creating a Macro in Minitab Using Minitab Software 4
A A macro-process structure approach to auditing for ISO 9001:2000(8) General Auditing Discussions 19
M Macro to connect to Access Database to get to data - Minitab Macro help Using Minitab Software 1
M Minitab macro vs. Layout tool Using Minitab Software 9
A Effectiveness of Training... micro or macro? ISO 9000, ISO 9001, and ISO 9004 Quality Management Systems Standards 29
M Macro that will perform a normality test and capability analysis - Minitab help Using Minitab Software 1
M Where to find an acceptance sampling excel macro or .xls template? Inspection, Prints (Drawings), Testing, Sampling and Related Topics 6
M SPC Excel macro add-in - File Attached Excel .xls Spreadsheet Templates and Tools 23
M Cleanroom Question Manufacturing and Related Processes 4
T Aircraft GAPP Software Testing Compliance Question AS9100, IAQG, NADCAP and Aerospace related Standards and Requirements 1
sonflowerinwales Quick question M3 screw plug gauge AS9100, IAQG, NADCAP and Aerospace related Standards and Requirements 0
B FDA regulations medical device prescription fulfillment DME question US Medical Device Regulations 0
M An interesting question about import company Other Medical Device Regulations World-Wide 5
Sam.F Question about training Training - Internal, External, Online and Distance Learning 17
B Labeling question about different manufacturers on a single label Manufacturing and Related Processes 4
J Question regarding classification of custom made device EU Medical Device Regulations 5
Sam.F Question about granite surface plates out of spec AS9100, IAQG, NADCAP and Aerospace related Standards and Requirements 9
Ed Panek MDR question - Meaning of Stability CE Marking (Conformité Européene) / CB Scheme 6
B GD&T Question, True Position Confusion Inspection, Prints (Drawings), Testing, Sampling and Related Topics 2
D Initial Importer question Other US Medical Device Regulations 1
Ed Panek Calibration question Manufacturing and Related Processes 4
M Class Exempt Medical Device Recall Question US Food and Drug Administration (FDA) 3
sonflowerinwales Metric or Imperial; that is the question... After Work and Weekend Discussion Topics 6
M Can someone help me with this CMM programming question? Manufacturing and Related Processes 2
A A strange question about predicate device selected in 510(k) submission Medical Device and FDA Regulations and Standards News 8
S Question regarding AQL - ISO 3951 Inspection, Prints (Drawings), Testing, Sampling and Related Topics 0
D Document Control Question involving DocuSign US Food and Drug Administration (FDA) 6
JoeRandom11 Question about Customer Supplied Equipment AS9100, IAQG, NADCAP and Aerospace related Standards and Requirements 2
M ISO 13485: 2016 Lot numbering question ISO 13485:2016 - Medical Device Quality Management Systems 4
S Nadcap - Heat Treatment Proof of Verification question for Digital results AS9100, IAQG, NADCAP and Aerospace related Standards and Requirements 5

Similar threads

Top Bottom