Fair value of financial instruments - Additional Information (Detail) - CAD ($) $ in Millions |
3 Months Ended | 9 Months Ended | ||
|---|---|---|---|---|
Jul. 31, 2026 |
Jul. 31, 2025 |
Jul. 31, 2026 |
Jul. 31, 2025 |
|
| Disclosure of fair value measurement of assets and liabilities [line Items] | ||||
| Transfers out of Level 1 to Level 2 | $ 0 | |||
| Transfers out of Level 2 to Level 1 | $ 0 | 0 | $ 0 | $ 0 |
| Transfers out of Level 2 to Level 3 | 0 | $ 0 | ||
| Investment U.S. federal, state, municipal and agencies [member] | ||||
| Disclosure of fair value measurement of assets and liabilities [line Items] | ||||
| Transfers out of Level 1 to Level 2 | 135 | 574 | ||
| Trading U.S. federal, state, municipal and agencies debt [Member] | ||||
| Disclosure of fair value measurement of assets and liabilities [line Items] | ||||
| Transfers out of Level 1 to Level 2 | $ 1,375 | $ 1,858 | $ 938 | |