At a time user is creating 1 ledger hence in such case unique will not work. Unique is working if line is repeating. Here u need to gather all ledger master in collection. And use filter item count function.