Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
stephane_kosior
Creator
Creator

Comment faire un graphique avec condition ?

Bonjour,

Je suis novice sur Qlikview et je rencontre un problème qui à mon avis va être résolu rapidement par les experts que vous êtes ...

Dans ma feuille, je souhaiterais réaliser plusieurs graphiques selon certaines conditions. Par exemple, je souhaiterais réaliser un graphique :

- qui se met à jour en fonction de la période sélectionnée (une liste de sélection)

- qui fait la somme du champs Montant

- mais je ne souhaiterais pas qu'il fasse la somme de tous les montants. Je veux uniquement les montants dont les comptes du champ "Compte" sont compris entre 700000 et 709000

Vous l'aurez compris, je veux faire un graph représentant le chiffre d'affaires !

Comment faire ?

Merci

Stéphane

18 Replies
Nicole-Smith

What is the error message?

stephane_kosior
Creator
Creator
Author

The script is :

SQL SELECT "Y_AXE",

   Date("Y_DATECOMPTABLE",'DD/MM/YYYY') as Date,

      [Y_DEBIT] as Débit,

     [Y_CREDIT] as Crédit,

     "Y_EXERCICE" as Exercice,

     "Y_GENERAL" as Commpte,

     "Y_LIBELLE" as Libellé,

     "Y_NUMEROPIECE" as "Numéro Pièce",

     "Y_NUMLIGNE" as "Numéro Ligne",

     "Y_PERIODE" as Période,

     "Y_REFINTERNE" as "Référence Interne",

     "Y_REFLIBRE" as "Référence Libre",

     "Y_SECTION" as Section,

     "Y_GENERAL"+"Y_SECTION" as id

FROM "IN_FLEX".dbo.ANALYTIQ

WHERE "Y_AXE"='A1'

;

The error message is "SQL##f - SqlState: 37000, ErrorCode: 195, ErrorMsg: [Microsoft][ODBC SQL Server Driver][SQL Server]'Date' n'est pas une option nom de fonction intégrée reconnue."

Nicole-Smith

Change your script to:

LOAD *,

     Date("Y_DATECOMPTABLE",'DD/MM/YYYY') as Date;

SQL SELECT "Y_AXE",

   "Y_DATECOMPTABLE",

      [Y_DEBIT] as Débit,

     [Y_CREDIT] as Crédit,

     "Y_EXERCICE" as Exercice,

     "Y_GENERAL" as Commpte,

     "Y_LIBELLE" as Libellé,

     "Y_NUMEROPIECE" as "Numéro Pièce",

     "Y_NUMLIGNE" as "Numéro Ligne",

     "Y_PERIODE" as Période,

     "Y_REFINTERNE" as "Référence Interne",

     "Y_REFLIBRE" as "Référence Libre",

     "Y_SECTION" as Section,

     "Y_GENERAL"+"Y_SECTION" as id

FROM "IN_FLEX".dbo.ANALYTIQ

WHERE "Y_AXE"='A1'

;

stephane_kosior
Creator
Creator
Author

ok it works but now I can't use the expressions :

Expressions:

Current Year: sum({<Compte={'>=700000<=709000'},Date={'>=$(=makedate(year(today),1,9)<=$(=makedate(year(today),12,31))'}>}Crédit)

Last Year: sum({<Compte={'>=700000<=709000'},Date={'>=$(=makedate(year(today)-1,1,9)<=$(=makedate(year(today)-1,12,31))'}>}Crédit)

There is no result  any idea ?

Nicole-Smith

Can you post a .qvw?  I can't really help you out unless you do.

Preparing examples for Upload - Reduction and Data Scrambling

stephane_kosior
Creator
Creator
Author

here it is ?

Nicole-Smith

You don't have any data for account numbers between 70000000 and 70900000 for this year, so that's why you're seeing blank data:

The same goes for last year (once again, no data for those account numbers):

stephane_kosior
Creator
Creator
Author

I disagree ... For february 2013, there are some figures with the account 70100000. Am I wrong ?

Nicole-Smith

You're right--I was looking at the data incorrectly.

Your expression should be:

=sum({<Compte={'>=70000000<=70900000'},Date={'>=$(=makedate(year(today())-1,1,9))<=$(=makedate(year(today())-1,12,31))'}>}Crédit)