How to count rows in database with the same value and show it on Jasper Report?

Client Table                                                                           Loanaccount Table

ENCODEDKEY     LASTNAME                                         ACCOUNTHOLDERKEY     

123456                    John                                                       123456
134679                    Smith                                                     123456
246810                    McDonald                                              123456


I'm new in Jaspersoft Studio
How can I show in my report how many times an ENCODEDKEY is show in the ACCOUNTHOLDERKEY?
Thank for the help. Much appreciated 


dhie's picture
Joined: Jan 25 2018 - 12:30am
Last seen: 4 years 2 months ago

1 Answer:

Isn't this more of a query question? How about

   COUNT( la.accountholderkey) AS loans
FROM client c
LEFT OUTER JOIN loanaccount la ON la.accountholderkey = c.encodedkey



AThompson_1's picture
Joined: Nov 12 2015 - 3:24pm
Last seen: 4 years 1 week ago