You need to sign in to do that
Don't have an account?
Kenneth Kimbrell
So I have a function that is basically setting the map's key with a string of start date to end date. So far what I have accomplished is to group the events by week. Now I need to nest the grouping more and group by week and by bookers, then roll up count for each booked appt for that week. Any ideas would be greatly appreciated. Thanks.
How to group data with nested maps
I am working on trying to group my Event data with maps. What I am trying to accomplish is to group my Events in weeks > bookers > roll up count for booked appt for each week. My logic so far is:
map<string,list<Event>> Date2Event = new map<string,list<Event>>(); for(Event e: eventLst){ if(!Date2Event.containsKey(dateMapKey(e.CreatedDate))){ Date2Event.put(dateMapKey(e.CreatedDate), new list<Event>()); } Date2Event.get(dateMapKey(e.CreatedDate)).add(e); } public string dateMapKey(datetime dt){ datetime myDt = dt; date myDate = myDt.date(); date StartOfWeekDate = myDate.toStartOfWeek(); string mapKey = StartOfWeekDate.format() + '-' + StartOfWeekDate.addDays(6).format(); return mapKey; }
So I have a function that is basically setting the map's key with a string of start date to end date. So far what I have accomplished is to group the events by week. Now I need to nest the grouping more and group by week and by bookers, then roll up count for each booked appt for that week. Any ideas would be greatly appreciated. Thanks.
after some time, I finally decided the best design patter for the nested mapping. I will post my answer here for others, since the responses I get are sometimes too generalized than what is needed.
All Answers
Try using this structure of map:
Map<String,Map<String,List<Event>>
This would be map of weekday > bookers Name or if you have it as a record then use Id > total rollup of the booker for that week.
Cheers!!!!
(https://ringtonesmobile.net (https://ringtonesmobile.net/)) - (https://ringtonesmobile.net/bollywood)
Can you show me an example of how I might use a nested map while looping through the events?
after some time, I finally decided the best design patter for the nested mapping. I will post my answer here for others, since the responses I get are sometimes too generalized than what is needed.
I finally decided the best design patter for the nested mapping. I will post my answer here for others, since the responses I get are sometimes too generalized than what is needed MyPrepaidCenter (https://myprepaidcenter.net/).
Vidmate (https://uptofast.com/android/vidmate) at https://uptofast.com/
Simple!
Download Now: https://mp3ringtonesdownload.net
I bet you will enjoy the music ringtones - MP3 Ringtones 888 Plus
liteblue (https://litebluedl.com/)
ncsecu login (https://litebluedl.com/ncsecu-login/)
prepaidgiftbalance (https://prepaidgiftbalancedl.com/)
tamilrockers (https://prosideas.com/)
MY NAME IS Nicholas Altimore (https://www.myprepaidcenter.live) and I am the CEO at myprepaidcenter.
Best Games For IOS: https://taigame.me/game-hay-ios/
Activate My Vanilla Debit Card Online (https://myvanilladebitcard.site/)
Duke Energy Login (https://dukeenergybillpay.co/)
Restaurant Surveys (https://surveylila.com/)
Will give it a try for MyprepaidCenter Balance check https://mycenterpre.shop/