Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How calculate a total

Hi all, 

I have  2 tables "consultation" et "bénéficiaire" and i want count the number of consultations per beneficiary.

I tried with this function 

(consultation.idBeneficiaire == beneficiaire.idBeneficiaire)? (NombreTotal = NombreTotal+1) : 0 

 

but i receive a message of error in figure 2.

 I hope receive your help for resolve my problem.

 

Thank you. 

 

Thank you for all.

Labels (2)
14 Replies
Anonymous
Not applicable
Author

I delete the "Annee" attribute, 

and i delete the tAggregateRow, but i find the same error. 0683p000009M9p6.png


job sans aggregate.png
sequence cons.png
TRF
Champion II
Champion II

You can go to the source code to find the error.
However, reviewing the solution, if you want 1 record per idBeneficiaire, tAggregateRow is better. Using tMap with sequence you'll have n records with the NombreTotal field incremented from 1 to n. So you will have to sort the result then get the high value for each idBeneficiaire.
Not so easy. Definitively consider the tAggregateRow option.
It's time for me.
Get your next message in the morning.
Anonymous
Not applicable
Author

ok , Thank you. 

 

and have a good evening.

TRF
Champion II
Champion II

Hi,

Did you get your solution?

Else, here is a new proposal:

0683p000009Lsbz.png

 

I have 2 tables:

- beneficiaire with an id and a name:

0683p000009Lsc9.png

- consultation with an idbeneficiaire:

0683p000009LsRw.png

The objective is to get the number of consultations for a beneficiaire.

So, the 2 tables are joined using a tMap with beneficiaire as the main table and consultation as the lookup table.

Before to join these 2 tables, I use a tAggregateRow to count the number of consultation records per beneficiaire (see previous answer to see the configuration for this component).

Here is the tMap:

0683p000009LsSA.png

And finally, the result:

0683p000009LscE.png

What else?

Anonymous
Not applicable
Author

Good Morning, 

 

yes i found a solution as in picture.

and now i want load my data cube with tPaloOutputMulti.

i'll launch a new topic above.

 

thank you


sortietotalparAnnee.png