IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

SAS Base Discussion :

sous total sas


Sujet :

SAS Base

  1. #1
    Membre du Club
    Femme Profil pro
    Architecte technique
    Inscrit en
    Avril 2015
    Messages
    86
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 34
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Architecte technique

    Informations forums :
    Inscription : Avril 2015
    Messages : 86
    Points : 46
    Points
    46
    Par défaut sous total sas
    Hello,

    j'aimerais afficher dans un même tableau un récapitulatif des pourboires . J'aimerais afficher par année et par mois la somme des pourboires puis faire des sous totaux par année de la variable pourboire puis faire la somme totale des pourboires des années 2018 et 2019. Tout cela regroupé dans le même tableaux. Voici ma table :


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    data year_frst;
       input year month pourboire ;
       datalines;
    2018 1 23
    2018 1 99
    2018 1 99
    2018 1 99
    2018 4 56
    2018 9 99
    2018 10 1010
    2019 1 23
    2019 2 949
    2019 2 959
    2019 2 92
    2019 4 26
    2019 10 219
    2019 10 110
    ;
    Quelqu'un a une idée?

    Je vous remercie

    Vaness

  2. #2
    Membre confirmé
    Homme Profil pro
    Consultant Finance/Assurance
    Inscrit en
    Décembre 2013
    Messages
    198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Consultant Finance/Assurance

    Informations forums :
    Inscription : Décembre 2013
    Messages : 198
    Points : 638
    Points
    638
    Par défaut
    Bonjour,

    Je te propose cette solution qui utilise la proc tabulate :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    data year_frst;
       input year month pourboire ;
       datalines;
    2018 1 23
    2018 1 99
    2018 1 99
    2018 1 99
    2018 4 56
    2018 9 99
    2018 10 1010
    2019 1 23
    2019 2 949
    2019 2 959
    2019 2 92
    2019 4 26
    2019 10 219
    2019 10 110
    ;run;
     
    proc format;
    picture pctfmt (round) other='009.0%';
    run;
     
    Proc tabulate data=year_frst style={just=c Borderbottomcolor=black font_size=10} ;
    Title FONT='Times New Roman' h=1.5 c = white "Analyse des pourboires";
    class year month / style={just=c BACKGROUND=CX4977B6 font_size=12 color=White FONT_WEIGHT=BOLD bordercolor=black };
    Classlev year month / style={just=c vjust=c BACKGROUND=CX4977B6 font_size=12 color=White FONT_WEIGHT=BOLD bordercolor=black};
    var Pourboire;
    table Year='Année' * (month='Mois' ALL='Total année' * {s={font_weight=bold background=verylightgrey font_size=10 just=center color=mob bordercolor=black font_style=italic}}) ALL='Total',
    	  Pourboire='Pourboire' * (sum=''*f=8.  pctsum<month>='' *f=pctfmt.)
    	  /misstext="0" BOX={label='' style={BACKGROUND=White font_size=1 color=White FONT_WEIGHT=BOLD bordertopcolor=white borderleftcolor=white borderbottomcolor=black borderrightcolor=black}};
    Keyword ALL / s={font_weight=bold background=verylightgrey just=center color=mob bordercolor=black font_style=italic font_size=10};
    run;
    Flo00154

  3. #3
    Membre du Club
    Femme Profil pro
    Architecte technique
    Inscrit en
    Avril 2015
    Messages
    86
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 34
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Architecte technique

    Informations forums :
    Inscription : Avril 2015
    Messages : 86
    Points : 46
    Points
    46
    Par défaut pb affichage label proc report
    hello

    merci flo00154 pour ta réponse. quand je lance ton code j'ai ce message d'errreur qui apparait... je comprends pas ce qu'est PctSum?!

    ERROR: PctSum base is not in table. A PctSum crossing has no denominator.


    de plus je viens de voir ta réponse. J'ai donc continuer sur proc report j'ai réussi à calculer les sous totaux et le total par année puis la somme des années mais je n'arrive pas à afficher les labels 'subT' et 'total'.. voici mon code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    proc report data= pourboire_t nowd;
     
    	COLUMNS YEAR MONTH somme_pourboire Nombre ;
    	define year /group ;
    	define month / group ;
    	break after year / ol skip summarize suppress; 
    	rbreak after/summarize  dol dul ;
    	compute after year;
    	year='subT';
    	endcomp;
    	compute after;
    	 year='total';
    	endcomp;
    run;
    Je vous remercie


    Vaness

  4. #4
    Membre confirmé
    Homme Profil pro
    Consultant Finance/Assurance
    Inscrit en
    Décembre 2013
    Messages
    198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Consultant Finance/Assurance

    Informations forums :
    Inscription : Décembre 2013
    Messages : 198
    Points : 638
    Points
    638
    Par défaut
    Bonjour,

    Cette option te permet juste de calculer un % en fonction d'une variable, tu peux supprimer ce point pour avoir uniquement la somme comme tu le souhaitais :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    data year_frst;
       input year month pourboire ;
       datalines;
    2018 1 23
    2018 1 99
    2018 1 99
    2018 1 99
    2018 4 56
    2018 9 99
    2018 10 1010
    2019 1 23
    2019 2 949
    2019 2 959
    2019 2 92
    2019 4 26
    2019 10 219
    2019 10 110
    ;run;
     
    Proc tabulate data=year_frst style={just=c Borderbottomcolor=black font_size=10} ;
    Title FONT='Times New Roman' h=1.5 c = white "Analyse des pourboires";
    class year month / style={just=c BACKGROUND=CX4977B6 font_size=12 color=White FONT_WEIGHT=BOLD bordercolor=black };
    Classlev year month / style={just=c vjust=c BACKGROUND=CX4977B6 font_size=12 color=White FONT_WEIGHT=BOLD bordercolor=black};
    var Pourboire;
    table Year='Année' * (month='Mois' ALL='Total année' * {s={font_weight=bold background=verylightgrey font_size=10 just=center color=mob bordercolor=black font_style=italic}}) ALL='Total',
    	  Pourboire='Pourboire' * (sum=''*f=8. )
    	  /misstext="0" BOX={label='' style={BACKGROUND=White font_size=1 color=White FONT_WEIGHT=BOLD bordertopcolor=white borderleftcolor=white borderbottomcolor=black borderrightcolor=black}};
    Keyword ALL / s={font_weight=bold background=verylightgrey just=center color=mob bordercolor=black font_style=italic font_size=10};
    run;
    Flo00154

  5. #5
    Membre du Club
    Femme Profil pro
    Architecte technique
    Inscrit en
    Avril 2015
    Messages
    86
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 34
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Architecte technique

    Informations forums :
    Inscription : Avril 2015
    Messages : 86
    Points : 46
    Points
    46
    Par défaut
    ok super Merci beaucoup flo00154


    Vaness

Discussions similaires

  1. [VB.NET] Sous-total et crystal Report
    Par olbi dans le forum Windows Forms
    Réponses: 1
    Dernier message: 12/04/2006, 09h49
  2. [EXCEL] Fonction sous.total
    Par repié dans le forum Macros et VBA Excel
    Réponses: 16
    Dernier message: 15/02/2006, 10h13
  3. Sous-total dans un etat
    Par Mr White dans le forum Access
    Réponses: 1
    Dernier message: 26/10/2005, 11h47
  4. Pb de total et de sous total
    Par PAINCO dans le forum Access
    Réponses: 22
    Dernier message: 23/06/2005, 15h17
  5. [CR] Sous Total par page
    Par adrien_78 dans le forum SAP Crystal Reports
    Réponses: 16
    Dernier message: 19/01/2005, 12h29

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo