Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a database from which I am trying to get information, similar to the table below. I have created a pivot table to give me the number of accounts with each bank using Count(Distinct Account). However I am having trouble creating another column beside the total for each bank which shows the percentage of the total number of accounts. The second table shows what I am trying to do. I can't seem to find any other query on the forum which covers this. Any help would be much appreciated.
Thanks,
Iain
| Account | Bank Name |
| 22 | Bank A |
| 23 | Bank B |
| 24 | Bank A |
| 53 | Bank C |
| 25 | Bank A |
| 85 | Bank C |
| 46 | Bank A |
| 84 | Bank B |
| 36 | Bank D |
| 10 | Bank A |
| 13 | Bank D |
| 16 | Bank B |
| 33 | Bank D |
| 49 | Bank B |
| 54 | Bank C |
| 62 | Bank A |
| 78 | Bank D |
| 95 | Bank B |
| 72 | Bank D |
| 64 | Bank C |
| Bank A | 6 | 30% | |
| Bank B | 5 | 25% | |
| Bank C | 4 | 20% | |
| Bank D | 5 | 25% | |
| Grand Total | 20 |
The expression you need is:
Count(Account)/Count(TOTAL Account)
let me know
The expression you need is:
Count(Account)/Count(TOTAL Account)
let me know
Well that was simple.
Thanks for your help
Could you please mark the answer?
Thanks