You need to sign in to do that
Don't have an account?
revathy
Map<string,list<Date>> its possible to do it?
I have samll clarifications how to use Map<string,list<Date>> like that?
My scenario is :i have two fields Dealer number,Date from soql query i got the values below that.
Date ------ Dealer number
10/02/2017 10100
15/01/2017 10100
02/02/2017 10100
01/02/2017 10101
05/02/2017 10101
10/01/2017 10102
31/01/2017 10102
I want output based on Dealer number.see one Dealer having different dates.this Dealer 10100 having 3 different dates,Month of JAN(count is 1) and Month Feb(count is 2).count is calucuted based on same month based.
output should be:
Dealer-----FebMonth(Count)-----JanMonth(Count)
10100 ----------------2-----------1
please guide me how to achive this scenario?
Advanced thanks
My scenario is :i have two fields Dealer number,Date from soql query i got the values below that.
Date ------ Dealer number
10/02/2017 10100
15/01/2017 10100
02/02/2017 10100
01/02/2017 10101
05/02/2017 10101
10/01/2017 10102
31/01/2017 10102
I want output based on Dealer number.see one Dealer having different dates.this Dealer 10100 having 3 different dates,Month of JAN(count is 1) and Month Feb(count is 2).count is calucuted based on same month based.
output should be:
Dealer-----FebMonth(Count)-----JanMonth(Count)
10100 ----------------2-----------1
please guide me how to achive this scenario?
Advanced thanks
Please find sample code here
Map<String,List<Date>> mapOf =new Map<String,List<Date>>()
If(mapOf.containsKey('Key')){
mapOf.get('Key').add(new Date());
}else{
mapOf.put('Key' , new List<Date>{newDate})
}
you can use Map<string,list<Date>> for your functionality.
Please find the sample code below.