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

Access Discussion :

Graphique en courbe pour suivie de l'évolution du CA mois par mois


Sujet :

Access

  1. #1
    Membre du Club
    Homme Profil pro
    Responsable RH
    Inscrit en
    Octobre 2016
    Messages
    253
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Responsable RH
    Secteur : Alimentation

    Informations forums :
    Inscription : Octobre 2016
    Messages : 253
    Points : 46
    Points
    46
    Par défaut Graphique en courbe pour suivie de l'évolution du CA mois par mois
    Bonjour le forum
    c'est une premiere pour moi. j'aimerais créer un graphique, en courbe afin de suivre l'évolution du chiffre d'affaire.

    1 courbe par année
    sur le coté gauche, une echelle de montant
    sur le bas, les mois janvier, février, ...

    je ne sais pas comment m'y prendre, si je dois partir d'une requete, d'une table ...
    je vous joint ci-dessous la liste de mes tables et de mes requetes. au besoins, je peux joindre ma base, ou d'autre copie ecran des données ...
    Nom : Capture.JPG
Affichages : 129
Taille : 32,2 Ko

    un petit coup de pouce que je puisse commencer mon projet, ne serait pas de refus.

    Merci d'avance

  2. #2
    Membre du Club
    Homme Profil pro
    Responsable RH
    Inscrit en
    Octobre 2016
    Messages
    253
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Responsable RH
    Secteur : Alimentation

    Informations forums :
    Inscription : Octobre 2016
    Messages : 253
    Points : 46
    Points
    46
    Par défaut
    Bonsoir le forum.
    En cherche un peu, j'ai trouvé un tuto.
    https://argyronet.developpez.com/off...ProjectPicture

    j'ai essayé de l'adapter à ce que je voulais, j'y suis plus ou moins arrivé ... tout commence à ce compliqué sur le codage.

    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
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    Option Compare Database
     
    Private Sub cmbClients_AfterUpdate()
     
    Dim strSQL As String
    Dim strCategory As String
      'Initialisation de la variable au contenu de la liste
      strCategory = Me!cmbClients.Text
      'Initialisation de la chaîne SQL
      strSQL = "SELECT [Client_1], Sum([mois1]) AS [janvier]," & _
      "Sum([mois2]) AS [février],Sum([mois3]) AS [Mars],Sum([mois4]) AS [avril],Sum([mois5]) AS [mai],Sum([mois6]) AS [Juin],Sum([mois7]) AS [Juillet],Sum([mois8]) AS [Août],Sum([mois9]) AS [Septembre],Sum([mois10]) AS [ctobre],Sum([mois11]) AS [Novembre],Sum([mois12]) AS [Décembre]"
      strSQL = strSQL & vbCrLf & "FROM R_Graphique_facturation_entre_date"
      strSQL = strSQL & vbCrLf & "GROUP BY [Client_1]"
      'Initialisation de la condition WHERE avec la catégorie
      strSQL = strSQL & vbCrLf & "HAVING ((([Client_1])=" & Chr(34) & _
      strCategory & Chr(34) & "));"
      'Affectation du controle Frame
      Me!fraCategories = 2
      'Affectation de la nouvelle source et mise à jour de graphique
      Graphique3.RowSource = strSQL
      Graphique3.Requery
    End Sub
     
    Private Sub fraCategories_AfterUpdate()
    Dim strSQL As String
     
      Select Case Me!fraCategories
        Case 1 'Toutes
        'Désactivation du ComboBox et vidage
          cmbClients.Enabled = False
          Select Case fraQuartet
            Case 1 'Janvier
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[[mois1]) AS [Janvier]"
            Case 2 'Février
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois2]) AS [Février]"
            Case 3 'Mars
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois3]) AS [Mars]"
            Case 4 'Avril
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois4]) AS [Avril]"
               Case 5 'Mai
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois5]) AS [Mai]"
               Case 6 'Juin
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois6]) AS [Juin]"
               Case 7 'Juillet
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois7]) AS [Juillet]"
               Case 8 'Aout
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois8]) AS [Août]"
               Case 9 'Septembre
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois9]) AS [Spetembre]"
               Case 10 'Octobre
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois10]) AS [Octobre]"
               Case 11 'Novembre
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois11]) AS [Novembre]"
               Case 12 'Décembrere
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois12]) AS [Décembre]"
     
            Case 13 'Tous
              strSQL = "SELECT [Client_1],Sum([mois1]) AS [janvier]," & _
              "Sum([mois2]) AS [février],Sum([mois3]) AS [Mars],Sum([mois4]) AS [avril],Sum([mois5]) AS [mai],Sum([mois6]) AS [Juin],Sum([mois7]) AS [Juillet],Sum([mois8]) AS [Août],Sum([mois9]) AS [Septembre],Sum([mois10]) AS [ctobre],Sum([mois11]) AS [Novembre],Sum([mois12]) AS [Décembre]"""
          End Select
          strSQL = strSQL & vbCrLf & "FROM R_Graphique_facturation_entre_date"
          strSQL = strSQL & vbCrLf & "GROUP BY R_Graphique_facturation_entre_date.[Client_1];"
          Graphique3.RowSource = strSQL
          Graphique3.Requery
        Case 2 'Une seule
        'Activation du ComboBox avec Focus et déroulement
        cmbClients.Enabled = True
        cmbClients.SetFocus
        cmbClients.Dropdown
      End Select
    End Sub
     
     
    Private Sub fraQuartet_AfterUpdate()
    Dim strSQL As String
    Dim strCategory As String
     
      Select Case Me!fraCategories
            Case 1 'Janvier
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[[mois1]) AS [Janvier]"
            Case 2 'Février
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois2]) AS [Février]"
            Case 3 'Mars
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois3]) AS [Mars]"
            Case 4 'Avril
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois4]) AS [Avril]"
               Case 5 'Mai
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois5]) AS [Mai]"
               Case 6 'Juin
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois6]) AS [Juin]"
               Case 7 'Juillet
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois7]) AS [Juillet]"
               Case 8 'Aout
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois8]) AS [Août]"
               Case 9 'Septembre
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois9]) AS [Spetembre]"
               Case 10 'Octobre
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois10]) AS [Octobre]"
               Case 11 'Novembre
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois11]) AS [Novembre]"
               Case 12 'Décembrere
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois12]) AS [Décembre]"
              Case 13 'Tous
              strSQL = "SELECT [Client_1],Sum([mois1]) AS [janvier]," & _
              "Sum([mois2]) AS [février],Sum([mois3]) AS [Mars],Sum([mois4]) AS [avril],Sum([mois5]) AS [mai],Sum([mois6]) AS [Juin],Sum([mois7]) AS [Juillet],Sum([mois8]) AS [Août],Sum([mois9]) AS [Septembre],Sum([mois10]) AS [ctobre],Sum([mois11]) AS [Novembre],Sum([mois12]) AS [Décembre]"""
          End Select
          strSQL = strSQL & vbCrLf & "FROM R_Graphique_facturation_entre_date"
          strSQL = strSQL & vbCrLf & "GROUP BY R_Graphique_facturation_entre_date.[Client_1];"
          Graphique3.RowSource = strSQL
          Graphique3.Requery
        Case 2 'Une seule
          cmbClients.SetFocus
          If Len(Me!cmbClients.Text) Then
            strCategory = Me!cmbClients.Text
          Select Case fraQuartet
            Case 1 'Janvier
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[[mois1]) AS [Janvier]"
            Case 2 'Février
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois2]) AS [Février]"
            Case 3 'Mars
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois3]) AS [Mars]"
            Case 4 'Avril
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois4]) AS [Avril]"
               Case 5 'Mai
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois5]) AS [Mai]"
               Case 6 'Juin
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois6]) AS [Juin]"
               Case 7 'Juillet
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois7]) AS [Juillet]"
               Case 8 'Aout
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois8]) AS [Août]"
               Case 9 'Septembre
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois9]) AS [Spetembre]"
               Case 10 'Octobre
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois10]) AS [Octobre]"
               Case 11 'Novembre
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois11]) AS [Novembre]"
               Case 12 'Décembrere
              strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], " & _
              "Sum(R_Graphique_facturation_entre_date.[mois12]) AS [Décembre]"
              Case 13 'Tous
              strSQL = "SELECT [Client_1],Sum([mois1]) AS [janvier]," & _
              "Sum([mois2]) AS [février],Sum([mois3]) AS [Mars],Sum([mois4]) AS [avril],Sum([mois5]) AS [mai],Sum([mois6]) AS [Juin],Sum([mois7]) AS [Juillet],Sum([mois8]) AS [Août],Sum([mois9]) AS [Septembre],Sum([mois10]) AS [ctobre],Sum([mois11]) AS [Novembre],Sum([mois12]) AS [Décembre]"""
          End Select
            strSQL = strSQL & vbCrLf & "FROM R_Graphique_facturation_entre_date"
            strSQL = strSQL & vbCrLf & "GROUP BY R_Graphique_facturation_entre_date.[Client_1]"
            'Initialisation de la condition WHERE avec la catégorie
            strSQL = strSQL & vbCrLf & "HAVING ((([Client_1])=" & Chr(34) & _
            strCategory & Chr(34) & "));"
            Graphique3.RowSource = strSQL
            Graphique3.Requery
          Else
            MsgBox "Une catégorie doit être sélectionnée !", 48, "Catégorie requise"
            cmbClients.SetFocus
            cmbClients.Dropdown
          End If
      End Select
    End Sub
    Je vous joint ma base, pour essayer de me mettre sur une piste ou pouvoir filer un coup de main ...
    Merci d'avance
    Fichiers attachés Fichiers attachés

  3. #3
    Membre du Club
    Homme Profil pro
    Responsable RH
    Inscrit en
    Octobre 2016
    Messages
    253
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Responsable RH
    Secteur : Alimentation

    Informations forums :
    Inscription : Octobre 2016
    Messages : 253
    Points : 46
    Points
    46
    Par défaut
    Bonjour,
    Personne n'a d'idée sur la correction du code ?? j'ai beaucoup de mal à trouver

  4. #4
    Expert éminent Avatar de hyperion13
    Homme Profil pro
    Webplanneur
    Inscrit en
    Octobre 2007
    Messages
    4 274
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : Réunion

    Informations professionnelles :
    Activité : Webplanneur

    Informations forums :
    Inscription : Octobre 2007
    Messages : 4 274
    Points : 6 583
    Points
    6 583
    Par défaut
    Bonjour
    De vous rappeler que les intervenants qui viennent prêter main forte ici sur DEV sont tous des bénévoles et ont encore pour la plus part et sauf erreur une activité.
    Donc, évitez de relancer, parce que cela ne va pas assez vite à votre goût.

    Vous indiquez un lien d'Argygonet que je salue au passage pour la construction d'un graph dans un form.
    Vous l'avez lu ? Parce que vu votre sub(); j'ai un doute.
    Tout en haut du tuto, il crée un query, il suffit simplement de l'adapter à votre bdd et rien de compliquer
    - remplacez nom de catégorie par Société, date de commande par date_facture, prix unitaire par CA.
    - remplacez nom de catégorie par Société, Année : Year([Date commande]) par Année : Year([DATE_Facture]), Trimestres : "Trim" & DatePart("q";[Date commande];1) par Mois : Format([DATE_Facture], "mmm"), Montant : CCurrency([Détails commandes].[Prix unitaire]*[Quantité]*(1-[Remise (%)])/100)*100 par Montant_HT-MontantRemise+MontantCNAPS
    - remplacez PIVOT "Trim " & DatePart("q",[Date commande],1) IN ("Trim 1","Trim 2","Trim 3","Trim 4") par PIVOT Format([DATE_Facture], "mmm") IN ("janv,"fév",... "nov","déc")
    etc.

  5. #5
    Rédacteur/Modérateur
    Avatar de argyronet
    Homme Profil pro
    Panseur de bobos en solutions ETL
    Inscrit en
    Mai 2004
    Messages
    5 128
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Panseur de bobos en solutions ETL
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2004
    Messages : 5 128
    Points : 12 185
    Points
    12 185
    Billets dans le blog
    5
    Par défaut
    Citation Envoyé par hyperion13 Voir le message
    Vous l'avez lu ? Parce que vu votre sub(); j'ai un doute.
    Bonjour,

    Merci hyperion13

    ************************************************************************************

    Votre bloc de code est bien complexe et en plus il y a des fautes de syntaxe "[[" par exemple.

    il est préférable de rendre plus générique votre Select Case :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
        Select Case fraQuartet
            Case 1 To 12
                strSQL = "SELECT R_Graphique_facturation_entre_date.[Client_1], Sum(R_Graphique_facturation_entre_date.mois" & Me.fraQuartet.Value & ") AS [" & StrConv(Format(DateSerial(Year(Now), 1, 1), "mmmm"), 3) & "]"
            Case Else
                'Tous les mois
                '[.....]
        End Select
    idem pour fraCategories

    Voyez en 2 lignes c'est casé et mieux qu'en 24 !
    Si les années avaient 3600 mois, votre Select Case ferait 3600 lignes ?

    En résumé, avant de dire ça marche pas, prenez votre bloc SQL et testez-le dans le QBE.

    Bon courage, ça va le faire...


    Argy

  6. #6
    Membre du Club
    Homme Profil pro
    Responsable RH
    Inscrit en
    Octobre 2016
    Messages
    253
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Responsable RH
    Secteur : Alimentation

    Informations forums :
    Inscription : Octobre 2016
    Messages : 253
    Points : 46
    Points
    46
    Par défaut
    Bonsoir,
    Merci pour vos réponses, je vais relire le tuto et reprendre mon code en prenant en compte vos remarques ...

  7. #7
    Membre du Club
    Homme Profil pro
    Responsable RH
    Inscrit en
    Octobre 2016
    Messages
    253
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Responsable RH
    Secteur : Alimentation

    Informations forums :
    Inscription : Octobre 2016
    Messages : 253
    Points : 46
    Points
    46
    Par défaut
    Je ne comprends pas et je ni arrive pas ... je dois etre C..
    en gros, il faut que je reparte de ma requete ??

  8. #8
    Expert éminent Avatar de hyperion13
    Homme Profil pro
    Webplanneur
    Inscrit en
    Octobre 2007
    Messages
    4 274
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : Réunion

    Informations professionnelles :
    Activité : Webplanneur

    Informations forums :
    Inscription : Octobre 2007
    Messages : 4 274
    Points : 6 583
    Points
    6 583
    Par défaut
    Commencez par le commencement
    qry_10_graph
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    SELECT T_Clients.Société, T_Factures.DATE_Facture, Year([DATE_Facture]) AS [$an], Month([DATE_Facture]) AS [$mois], Format([DATE_Facture],"mmm") AS [%mois], (Sum([Tx_Horaire_HT]*[Nb_d_hrs])-Sum(([Tx_Horaire_HT]*[Nb_d_hrs])*[Tx_Remise]))+(Sum([Tx_Horaire_HT]*[Nb_d_hrs]*[Tx_CNAPS])-Sum(([Tx_Horaire_HT]*[Nb_d_hrs])*[Tx_Remise]*[Tx_CNAPS])) AS Total_HT
    FROM T_Clients INNER JOIN (T_Factures INNER JOIN T_Factures_SF ON T_Factures.ID_Facture = T_Factures_SF.ID_Facture) ON T_Clients.ID_Client = T_Factures.Client_1
    GROUP BY T_Clients.Société, T_Factures.DATE_Facture, Year([DATE_Facture]), Month([DATE_Facture]), Format([DATE_Facture],"mmm")
    ORDER BY Year([DATE_Facture]), Month([DATE_Facture]);
    qry_10_graph_analyse_croisee
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    TRANSFORM Sum(qry_10_graph.Total_HT) AS SommeDeTotal_HT
    SELECT qry_10_graph.Société, qry_10_graph.[$an], Sum(qry_10_graph.Total_HT) AS [Total de Total_HT]
    FROM qry_10_graph
    GROUP BY qry_10_graph.Société, qry_10_graph.[$an]
    PIVOT qry_10_graph.[%mois] In ("janv","févr","mars","avr","mai","juin","juil","août","sept","oct","nov","déc");

  9. #9
    Membre du Club
    Homme Profil pro
    Responsable RH
    Inscrit en
    Octobre 2016
    Messages
    253
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Responsable RH
    Secteur : Alimentation

    Informations forums :
    Inscription : Octobre 2016
    Messages : 253
    Points : 46
    Points
    46
    Par défaut
    Hyperion13.
    je viens de vior ton message, mais entre temps, j'ai réfléchi à autre chose et voila se que je suis arrivé a faire ...
    il me reste à intégré les choix des années a comparer. et je vais ma baser sur ce que j'ai fait pour le graphique année pour faire le graphique par mois ...
    je reviens sur le post, dès que j'ai trouvé quelque chose ... ou si quelqu'un a quelque chose à me suggérer.
    Nom : Capture.PNG
Affichages : 83
Taille : 51,4 Ko

  10. #10
    Membre du Club
    Homme Profil pro
    Responsable RH
    Inscrit en
    Octobre 2016
    Messages
    253
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Responsable RH
    Secteur : Alimentation

    Informations forums :
    Inscription : Octobre 2016
    Messages : 253
    Points : 46
    Points
    46
    Par défaut
    Et voila, ça bug ...
    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
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    Private Sub Form_Load()
    Me.G_Graphique_par_annees.RowSource = currentDd.QueryDefs("R_Graphique_annee").SQL
    Me.G_Graphique_par_annees.Requery
    End Sub
     
    Private Sub LesAnnees_Click()
     Dim i As Long, sWh As String, sSQL As String
        sWh = ""
        For i = 0 To Me.LesAnnees.ListCount - 1
            If Me.LesAnnees.Selected(i) Then
                Debug.Print Me.LesAnnees.ItemData(i), Me.LesAnnees.Selected(i)
                sWh = sWh & " OR Année='" & Me.LesAnnees.ItemData(i) & "'"
            End If
        Next
        If sWh <> "" Then
            sWh = "WHERE " & Mid(sWh, 5)
        End If
     
        '---
        sSQL = CurrentDb.QueryDefs("R_Graphique_Annee").SQL
        If sWh <> "" Then
            sSQL = Replace(sSQL, "GROUP BY ", sWh & " GROUP BY ")
        End If
        Debug.Print sSQL
        Me.G_Graphique_par_annees.RowSource = sSQL
        Me.G_Graphique_par_annees.Requery
    End Sub
    Nom : Capture.PNG
Affichages : 88
Taille : 52,0 Ko

    Je ni comprends plus rien ...
    avec ma liste indépendante, j'aimerais pourvoir choisir les années a comparer ...
    je me suis basé sur un fichier que j'ai pu trouver en cherchant sur le net ...
    Si quelqu'un a une option a me donner.
    Fichiers attachés Fichiers attachés

  11. #11
    Expert éminent Avatar de hyperion13
    Homme Profil pro
    Webplanneur
    Inscrit en
    Octobre 2007
    Messages
    4 274
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : Réunion

    Informations professionnelles :
    Activité : Webplanneur

    Informations forums :
    Inscription : Octobre 2007
    Messages : 4 274
    Points : 6 583
    Points
    6 583
    Par défaut
    re,
    Le plus simple pour vous serait de passer par Excel (Données - Access) et de créer un TCD avec qry_10_graph.
    Le graphique associé au TCD vous permettrait de tout affcher ou de filtrer selon Année, Mois et Société (img)
    Et côté qualité de graph on y gagne avec Excel
    Images attachées Images attachées  

  12. #12
    Membre du Club
    Homme Profil pro
    Responsable RH
    Inscrit en
    Octobre 2016
    Messages
    253
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Responsable RH
    Secteur : Alimentation

    Informations forums :
    Inscription : Octobre 2016
    Messages : 253
    Points : 46
    Points
    46
    Par défaut
    Bonjour Hyperion13,

    Access je bidouille pas trop mal, je pense, mais excel et les TDC, je ne maitrisse pas du tout ...
    si vous me decomposer la marche à suivre, je suis preneur

  13. #13
    Expert éminent Avatar de hyperion13
    Homme Profil pro
    Webplanneur
    Inscrit en
    Octobre 2007
    Messages
    4 274
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : Réunion

    Informations professionnelles :
    Activité : Webplanneur

    Informations forums :
    Inscription : Octobre 2007
    Messages : 4 274
    Points : 6 583
    Points
    6 583
    Par défaut
    re (img)
    - ouvrir un nouveau classeur
    - onglet Données - Icône Access
    - parcourir l'emplacement de votre bdd
    - sélectionner votre qry
    - opter pour TCD
    - placer les éléments lignes/colonnes/valeurs
    - dans le ruban TCD à droite vous avez graphique TCD

    PS il se peut qu'il y ait une étape intermédiaire connexion OLE/Admin/sans mdp (confirmer sans rien changer)
    Images attachées Images attachées  

Discussions similaires

  1. Graphique pour suivi d'opérations bancaires
    Par Tchupacabra dans le forum Excel
    Réponses: 2
    Dernier message: 19/02/2018, 08h53
  2. Sous-totaux et problème pour un graphique en courbe
    Par Floflo57240 dans le forum QlikView
    Réponses: 5
    Dernier message: 23/05/2014, 15h29
  3. Réponses: 1
    Dernier message: 16/01/2013, 17h50
  4. Réponses: 1
    Dernier message: 04/08/2011, 10h11
  5. Librairies graphiques que choisir pour la portabilité ?
    Par SamRay1024 dans le forum OpenGL
    Réponses: 8
    Dernier message: 03/02/2005, 17h22

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