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

Staff member
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
Ed Panek Question from 13485 Auditor ISO 13485:2016 - Medical Device Quality Management Systems 2
C Question on KAFO (Knee Ankle Foot Orthosis device) classification CE Marking (Conformité Européene) / CB Scheme 0
T BMW GS 93010-2 Question Various Other Specifications, Standards, and related Requirements 1
S FDA 510(K) submission question US Food and Drug Administration (FDA) 4
Ron Rompen Question regarding CMM probe damage General Measurement Device and Calibration Topics 4
T FDA UDI Question - Class II Medical Device Other US Medical Device Regulations 1
C Complaint Return Sample Size Question 21 CFR Part 820 - US FDA Quality System Regulations (QSR) 4
8 Drawing Feature Question Inspection, Prints (Drawings), Testing, Sampling and Related Topics 8
D Question: How to analyze numerical and attribute data Reliability Analysis - Predictions, Testing and Standards 11
D Question on electronic signatures and initials on batch records ISO 13485:2016 - Medical Device Quality Management Systems 4
A Special Characteristic question from Automotive CSR Customer and Company Specific Requirements 9
Ron Rompen GDT Question - is this even correct? Inspection, Prints (Drawings), Testing, Sampling and Related Topics 3
A PPAP question for audit APQP and PPAP 16
C ISO Question - Do you say "I-S-O" or "I-Soh"? Misc. Quality Assurance and Business Systems Related Topics 14
D Question regarding where "validations" fit according to ISO 13485:2016 ISO 13485:2016 - Medical Device Quality Management Systems 1
D Question on Supplier Quality (SCAR) ISO 13485:2016 - Medical Device Quality Management Systems 6
A +0/-.001 Tolerance question - Feature size is 1.249 +0/-.001 - Actually measures 1.2493 (.0003 OHL Inspection, Prints (Drawings), Testing, Sampling and Related Topics 12
D Question and advice for a supplier self audit questionnaire ISO 13485:2016 - Medical Device Quality Management Systems 6
D Question on using audit checklist ISO 13485:2016 ISO 13485:2016 - Medical Device Quality Management Systems 20
D Question on Documented Calibration versus ISO 17025 Accredited Calibration ISO 13485:2016 - Medical Device Quality Management Systems 2
A Design Change/ECO Related Question 21 CFR Part 820 - US FDA Quality System Regulations (QSR) 1
S Configuration Item definition question AS9100, IAQG, NADCAP and Aerospace related Standards and Requirements 3

Similar threads

Top Bottom