Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sebastien
Contributor II
Contributor II

SUM Formula

Good afternoon,

I have a problem with a SUM formula in sheet analysis.

The total is not good for somes total.

Please see a picture in attachment.

 

Sorry for my bad English I will explain in french for more details :

 

Nous avons une feuille d'analyse qui contient un regroupement de données et pour laquelle nous avons besoin d'avoir la somme des lignes regroupées selon plusieurs dimension.

1ère dimension (Imputation_heures)

2ème dimension (Motif)

3ème dimension (Nom)

J'ai besoin d'avoir le total des lignes au moins pour la dimension 3.

J'essaye avec la formule SUM(Nb_heures) mais le total ne correspond pas tout à fait. Par exemple sur l'image en attachement, je devrai trouver 55 alors qu'il ne m'affiche que 51. C'est idem pour la deuxième colonne qui correspond au montant.

J'ai regardé du côté de la formule Sum(Aggr( mais je ne comprend pas vraiment le principe car je suis nouveau sur Qlik. Pourriez-vous me guider pour trouver la solution à mon problème s'il vous plaît ?

Par avance merci,

Sébastien

1 Solution

Accepted Solutions
sebastien
Contributor II
Contributor II
Author

Hi Teis,

 

Finally we found the problem with the duplicate lines. We forgot to include the index in the source table.

Thank you again for your help

Salutations,

Seb

 

View solution in original post

3 Replies
teiswamsler
Partner - Creator III
Partner - Creator III

Hi Sebastian

It seems you may have some dublicates lines in the data model.

Try making a Table Chart containing fields used in your picture. All field as a dimention.

Br.
Teis

sebastien
Contributor II
Contributor II
Author

Hi Teis,

Thank you for your reply.

Effictivly there is duplicates lines when I had all fields as a dimension as you can see on new picture.

How I can delete this duplicates lines ?

I have try on my script but the duplicates lines are Always here.

heurecsv:

Load *;

CEM:

Load *;

imputheures:

Load distinct ALIGNE as NUM_LIGNE, MATRICULE_UTILISATEUR as matricule, NOM, POSTE, heurescsv.PKEY as code, Motif, Date, Nb_heures resident heurecsv;

Inner Join load Matricule as matricule, ERATE, CC as CC1 resident CEM;

Inner Join load CC1 resident GCRGSV;

 

Thank you very much for your help.

Seb

 

sebastien
Contributor II
Contributor II
Author

Hi Teis,

 

Finally we found the problem with the duplicate lines. We forgot to include the index in the source table.

Thank you again for your help

Salutations,

Seb