STATS TABLE CALC mystery

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

STATS TABLE CALC mystery

Mario Giesel-2
Hi,
hope anyone can help me with this:

* Let's say I have these data.

DATA LIST /id 1-2 age 3 group 4.
BEGIN DATA
1 11
2 21
3 31
4 11
5 21
6 11
7 21
8 10
9 20
1010
1110
1210
END DATA.
VAL LAB age 1 'Young' 2 'Medium' 3 'Old'.
VAL LAB group 1 'Yes' 0 'No'.

DEFINE @index(col = !TOKENS(1) /basis = !TOKENS(1) /process = !DEFAULT('ALL') !TOKENS(1))
STATS TABLE CALC SUBTYPE=" Custom table" PROCESS = !process
    /TARGET FORMULA = !QUOTE(!CONCAT(x,!col,"/x", !basis, " * 100")) DIMENSION = COLUMNS LEVEL = -1 LOCATION = !col LABEL="Index" MODE=AFTER /FORMAT CELLFORMAT = "#,###.##"  DECIMALS = 1 INVALID="".
!ENDDEFINE.

CTABLES 
      /TABLE age BY group [COUNT 'N' F40, COLPCT '%' F40.1]
      /CATEGORIES VARIABLES = age group TOTAL = YES LABEL = 'Total' POSITION = BEFORE.
@index col = 5 basis = 1.

* My question: how can the /FORMAT CELLFORMAT = "#,###.##" subcommand be changed so that decimals are indicated by a comma?
I tried various tricks but basically I don't understand how this format works. Any enlightenment is welcome.

Thanks,
Mario


Mario Giesel
Munich, Germany
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: STATS TABLE CALC mystery

Jon Peck
The pivot table formats automatically  adjust to  your locale, but the STATS TABLE CALC formats might not work that way.
You can, however, specify the format the way you want.
Write 
CELLFORMAT = "#.###,##"

On Tue, Feb 4, 2020 at 10:06 AM Mario Giesel <[hidden email]> wrote:
Hi,
hope anyone can help me with this:

* Let's say I have these data.

DATA LIST /id 1-2 age 3 group 4.
BEGIN DATA
1 11
2 21
3 31
4 11
5 21
6 11
7 21
8 10
9 20
1010
1110
1210
END DATA.
VAL LAB age 1 'Young' 2 'Medium' 3 'Old'.
VAL LAB group 1 'Yes' 0 'No'.

DEFINE @index(col = !TOKENS(1) /basis = !TOKENS(1) /process = !DEFAULT('ALL') !TOKENS(1))
STATS TABLE CALC SUBTYPE=" Custom table" PROCESS = !process
    /TARGET FORMULA = !QUOTE(!CONCAT(x,!col,"/x", !basis, " * 100")) DIMENSION = COLUMNS LEVEL = -1 LOCATION = !col LABEL="Index" MODE=AFTER /FORMAT CELLFORMAT = "#,###.##"  DECIMALS = 1 INVALID="".
!ENDDEFINE.

CTABLES 
      /TABLE age BY group [COUNT 'N' F40, COLPCT '%' F40.1]
      /CATEGORIES VARIABLES = age group TOTAL = YES LABEL = 'Total' POSITION = BEFORE.
@index col = 5 basis = 1.

* My question: how can the /FORMAT CELLFORMAT = "#,###.##" subcommand be changed so that decimals are indicated by a comma?
I tried various tricks but basically I don't understand how this format works. Any enlightenment is welcome.

Thanks,
Mario


Mario Giesel
Munich, Germany
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: STATS TABLE CALC mystery

Mario Giesel-2
Ah, I thought I was trying this variant as well.
But you are right, this way it works well!

Thanks a lot!
Mario

Mario Giesel
Munich, Germany


Am Dienstag, 4. Februar 2020, 22:16:15 MEZ hat Jon Peck <[hidden email]> Folgendes geschrieben:


The pivot table formats automatically  adjust to  your locale, but the STATS TABLE CALC formats might not work that way.
You can, however, specify the format the way you want.
Write 
CELLFORMAT = "#.###,##"

On Tue, Feb 4, 2020 at 10:06 AM Mario Giesel <[hidden email]> wrote:
Hi,
hope anyone can help me with this:

* Let's say I have these data.

DATA LIST /id 1-2 age 3 group 4.
BEGIN DATA
1 11
2 21
3 31
4 11
5 21
6 11
7 21
8 10
9 20
1010
1110
1210
END DATA.
VAL LAB age 1 'Young' 2 'Medium' 3 'Old'.
VAL LAB group 1 'Yes' 0 'No'.

DEFINE @index(col = !TOKENS(1) /basis = !TOKENS(1) /process = !DEFAULT('ALL') !TOKENS(1))
STATS TABLE CALC SUBTYPE=" Custom table" PROCESS = !process
    /TARGET FORMULA = !QUOTE(!CONCAT(x,!col,"/x", !basis, " * 100")) DIMENSION = COLUMNS LEVEL = -1 LOCATION = !col LABEL="Index" MODE=AFTER /FORMAT CELLFORMAT = "#,###.##"  DECIMALS = 1 INVALID="".
!ENDDEFINE.

CTABLES 
      /TABLE age BY group [COUNT 'N' F40, COLPCT '%' F40.1]
      /CATEGORIES VARIABLES = age group TOTAL = YES LABEL = 'Total' POSITION = BEFORE.
@index col = 5 basis = 1.

* My question: how can the /FORMAT CELLFORMAT = "#,###.##" subcommand be changed so that decimals are indicated by a comma?
I tried various tricks but basically I don't understand how this format works. Any enlightenment is welcome.

Thanks,
Mario


Mario Giesel
Munich, Germany
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD