Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI All,
I am having a ridiculous amount of trouble running this expression and can't think of another way of writing this and still getting the same result
aggr(count({$<CalendarMonthAndYear={'vMonthSpecific'},CallType={'o'},CallClassMapping={'Mobile'}>}Key),Digits, Extn, FirstName, Surname, CalendarMonthAndYear)
What the expresion does is the following
Additional information
Can someone explain or help me to get this expression to calculate without taking an hour ![]()
Thanks,
Byron
If vMonthSpecific is a variable then you probably don't need to aggregate over CalendarMonthAndYear since you're already limiting it to one value. If CalendarMonthAndYear is a date field you could make sure vMonthSpecific is a number and loose the single quotes. Comparing numbers is faster than comparing strings.
If you really want to improve performance, you might want to precalculate this in the script instead of in an expression. Something like:
PreCalculatedKeyCounts:
Load
Digits, Extn, FirstName, Surname, CalendarMonthAndYear, count(Key) as KeyCount
resident ...mydataset...
group by Digits, Extn, FirstName, Surname, CalendarMonthAndYear
where CallType = 'o' and CallClassMapping = 'Mobile';
If vMonthSpecific is a variable then you probably don't need to aggregate over CalendarMonthAndYear since you're already limiting it to one value. If CalendarMonthAndYear is a date field you could make sure vMonthSpecific is a number and loose the single quotes. Comparing numbers is faster than comparing strings.
If you really want to improve performance, you might want to precalculate this in the script instead of in an expression. Something like:
PreCalculatedKeyCounts:
Load
Digits, Extn, FirstName, Surname, CalendarMonthAndYear, count(Key) as KeyCount
resident ...mydataset...
group by Digits, Extn, FirstName, Surname, CalendarMonthAndYear
where CallType = 'o' and CallClassMapping = 'Mobile';
thanks for your reply mate. Removing the calendarmonthandyear did speed it up a little.
I think I will also take your suggestion about aggregating this in the script along with some other expressions which are causing a bit of trouble for me.
cheers,
byron