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 7
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
S Study sign off question / responsibilities ISO 17025 related Discussions 0
S Qualification question - ISO 13485 Reliability Analysis - Predictions, Testing and Standards 0
M Question for Auditors - "Off the Record" Conversation? General Auditing Discussions 14
D Question regarding ECO process, specifically for Life Science products and defining form fit and function ISO 13485:2016 - Medical Device Quality Management Systems 1
R Accelerated Aging - Creating test samples - Implantable medical device Question Other Medical Device Related Standards 4
A Question on Authorized Representative in Malaysia Other Medical Device Regulations World-Wide 1
D Limited Scope for second site Question? ISO 9000, ISO 9001, and ISO 9004 Quality Management Systems Standards 5
I ISO 2233:2000 Question - Medical Device Shipping/Transportation Validation Other ISO and International Standards and European Regulations 1
Anonymous16-2 Labeling Question (Dietary Supplements/Food) Pharmaceuticals (21 CFR Part 210, 21 CFR Part 211 and related Regulations) 1
T Question for: Cg & Cgk calculation General Measurement Device and Calibration Topics 3
N ASL Question for GitHub ISO 13485:2016 - Medical Device Quality Management Systems 6
hogheavenfarm GDT Flatness measurement question Inspection, Prints (Drawings), Testing, Sampling and Related Topics 10
A Question on ISO 14001:2015 - Are annual audits required? ISO 14001:2015 Specific Discussions 8
dinaroxentool Question about FDA Classification of a Device 21 CFR Part 820 - US FDA Quality System Regulations (QSR) 3
J Another DFAR question 252.225-7009 AS9100, IAQG, NADCAP and Aerospace related Standards and Requirements 0
F Conflict Mineral Smelter Question RoHS, REACH, ELV, IMDS and Restricted Substances 8
R NRTL - Scope Question - Off-the-Shelf Plug In IEC 60601 - Medical Electrical Equipment Safety Standards Series 0
D API 6A Certification Question Oil and Gas Industry Standards and Regulations 4
dinaroxentool Question about qualification as a medical device or accessory in Europe EU Medical Device Regulations 2
R DHR question: Traceability of components ISO 13485:2016 - Medical Device Quality Management Systems 2
C MDR - Question around software accesories EU Medical Device Regulations 2
K My question is, what/when is a nonconformity? Therefore what requires an NCR? Nonconformance and Corrective Action 9

Similar threads

Top Bottom