You could create a custom hash of the SOject Id and the date field. To ensure consistency, you probably want to break this out into a separate function.
private String getMapHash(Id objId, Date d){
return SObject.Id + myDate.format();
}
Map<String, Decimal> myMap = new Map<String, Decimal>();
myMap.put(getMapHash(SObject.Id, myDate), myDecimal);
Decimal d = myMap.get(getMapHash(SObject.Id, myDate));
Another option would be to create a Map<Id,Map<String,Decimal>>
. But this is more work and likely much slower.
Notice I used String
for the key for the date indexed Map. I'm not sure what would happen if you used the Date object itself. I suspect SF would hash two different Date Objects with the same value differently.