This is not clear
CTABLES works on the principle that you should be able to see the inputs on a calculation like a total, so if you hide a cell, it won't be used in the calculation. Using a hiding subtotal would not work here, but there is another way.
Run the table including the category you want to hide. Then use the OUTPUT MODIFY or the SPSSINC MODIFY TABLES extension command to hide that column. Note that this will not prevent someone from figuring out the value in that hidden column, though, using a little arithmetic.
If you can't figure this out, send me an spv file containing the table, and I'll show you the syntax. It would also be helpful to have the input data.
j
--
Original Message:
Sent: 11/10/2023 1:13:00 PM
From: Gamze Turunc
Subject: RE: Custom Tables: Hiding Category options missing / not enacted
Hi, I want to keep a category in the columns of the tables I created from the pivot table, but I still want this category to be included in the calculation. How can I do that? My custom table is attached, I want to hide "hayır" category from the table.
My syntax as follows:
CTABLES
/WEIGHT VARIABLE=FAKTOR_FERT
/VLABELS VARIABLES=CINSIYET agegroup1 DISIPLIN_AYRICALIK DISIPLIN_DAVRANIS_YANLIS
DISIPLIN_BAGIRMA DISIPLIN_BIRSEY_VERME DISIPLIN_SEVMEME DISIPLIN_VURMA DISIPLIN_SERT_VURMA
DISIPLIN_HAKIR_GORME DISIPLIN_TOKAT DISIPLIN_EL_KOL_BACAK_VURMA DISIPLIN_SIDDETLI_DOVME
DISIPLIN_KUCUK_DUSURME DISIPLIN_GORMEZDEN_GELME DISIPLIN_ARKADAS_GORUSTURMEME
DISIPLIN_HARCLIK_KESME
DISPLAY=LABEL
/TABLE CINSIYET [ROWPCT.COUNT PCT40.1] + agegroup1 [ROWPCT.COUNT PCT40.1] BY DISIPLIN_AYRICALIK +
DISIPLIN_DAVRANIS_YANLIS + DISIPLIN_BAGIRMA + DISIPLIN_BIRSEY_VERME + DISIPLIN_SEVMEME +
DISIPLIN_VURMA + DISIPLIN_SERT_VURMA + DISIPLIN_HAKIR_GORME + DISIPLIN_TOKAT +
DISIPLIN_EL_KOL_BACAK_VURMA + DISIPLIN_SIDDETLI_DOVME + DISIPLIN_KUCUK_DUSURME +
DISIPLIN_GORMEZDEN_GELME + DISIPLIN_ARKADAS_GORUSTURMEME + DISIPLIN_HARCLIK_KESME
/CATEGORIES VARIABLES=CINSIYET agegroup1 DISIPLIN_BAGIRMA DISIPLIN_BIRSEY_VERME DISIPLIN_SEVMEME
DISIPLIN_VURMA DISIPLIN_SERT_VURMA DISIPLIN_HAKIR_GORME DISIPLIN_TOKAT DISIPLIN_EL_KOL_BACAK_VURMA
DISIPLIN_SIDDETLI_DOVME DISIPLIN_KUCUK_DUSURME DISIPLIN_GORMEZDEN_GELME
DISIPLIN_ARKADAS_GORUSTURMEME DISIPLIN_HARCLIK_KESME ORDER=A KEY=VALUE EMPTY=INCLUDE
/CATEGORIES VARIABLES=DISIPLIN_AYRICALIK [0, 1, OTHERNM] EMPTY=INCLUDE
/CATEGORIES VARIABLES=DISIPLIN_DAVRANIS_YANLIS [0, 1, OTHERNM] EMPTY=INCLUDE
/CRITERIA CILEVEL=95.
------------------------------
Gamze Turunc
------------------------------
Original Message:
Sent: Tue February 28, 2023 10:58 AM
From: Jon Peck
Subject: Custom Tables: Hiding Category options missing / not enacted
You specify the variable that you want labels for and the variable whose values will constitute the labels. If you have a bunch of variables that need the same value labels, you specify only one labelling variable along with the list of variables to label. It goes through the cases and, for each value of the target variable, it picks up the value of the labeling variable. Then it creates the value label set for each target variable.
Here's an example from the syntax help.
STATS VALLBLS FROMDATA VARIABLES = x1 TO x5 LBLVARS = label.
--
Original Message:
Sent: 2/28/2023 10:53:00 AM
From: Michael O'Brien
Subject: RE: Custom Tables: Hiding Category options missing / not enacted
Thanks Jon,
That extension looks interesting but it seems to require 2 copies of the each variable to supply both the variables to be labelled and the source material
------------------------------
Michael
Original Message:
Sent: Tue February 28, 2023 10:35 AM
From: Jon Peck
Subject: Custom Tables: Hiding Category options missing / not enacted
Not directly, but if you install the STATS VALLBLS FROMDATA extension command from Extensions > Extension Hub (search for labels), it can create value label sets from string variables. The command will appear on the Data menu.
Here is an extract from the dialog help.
Create Value Labels from Data
This command creates value labels for a set of variables based on values of designated labelling variables in the dataset.Variables to Label Select the variables for which value labels should be created.
Label Variables Select the variables whose values will be used to create value labels for the first set of variables. Each pair of a value from the first set and the value from the corresponding variable in the second set are combined to define a value label.
• Either select as many variables in this set as are selected in the first set or select a single variable whose values will be used for all the first-set variables. Any conflicts or duplicate labels are reported.
• A blank labelling value does not create a value label. User missing value status is ignored by this command.
• If multiple values of the label variable exist for the same value of the variable to be labelled, then the last such value (of the label variable) in alphanumeric order is used.
--
Original Message:
Sent: 2/28/2023 9:51:00 AM
From: Michael O'Brien
Subject: RE: Custom Tables: Hiding Category options missing / not enacted
Is there a way to use the string values as value labels? There is alot of repetition in the strings as its not free form text
------------------------------
Michael
Original Message:
Sent: Tue February 28, 2023 09:45 AM
From: Jon Peck
Subject: Custom Tables: Hiding Category options missing / not enacted
If that option is greyed out, it is usually because the variable in question does not have any value labels. The exclusions can still be specified in syntax on the CATEGORIES subcommand, but the dialog box would have no way of knowing what to show.
--
Original Message:
Sent: 2/28/2023 4:37:00 AM
From: Michael O'Brien
Subject: Custom Tables: Hiding Category options missing / not enacted
I am having difficulty with hiding blank or empty categories in custom tables on this screen
Categories and Totals - IBM Documentation The options are all greyed out but also "Empty categories" is unticked and yet empty categories are still in the output. I followed this how-prevent-empty-categories-being-shown-spss-statistics-custom-tables but I don't have the ability to change the option
I suspect it may be related to the data type of the variable. Its a nominal string with no value labels but I'm not sure if that's correct and wary of manipulating variables for fear of data loss.
Any advice?
------------------------------
Michael
------------------------------