-% my ($i,$total);
-% while (my $key = shift @sorted_keys) {
-% $i++;
-% my $value = shift @sorted_values;
-% $total += $value;
-<tr class="<%$i%2 ? 'evenline' : 'oddline' %>">
+<%perl>
+ while (my $key = shift @sorted_keys) {
+ $i++;
+ my $value = shift @sorted_values;
+ $total += $value;
+</%perl>
+<tr class="<% $i%2 ? 'evenline' : 'oddline' %>">
+<%perl>
+# TODO sadly we don't have "creator.city is null" or alike support yet
+# so no link if the key is undef for now
+ if ( $PrimaryGroupBy !~ /(Hourly|Daily|Monthly|Annually)$/
+ && $key ne loc('(no value)') ) {
+ my $group = $PrimaryGroupBy; $group =~ s! !.!;
+ my %orig_keys = reverse %loc_keys;
+ my $QueryString = $m->comp('/Elements/QueryString',
+ Query => "$Query and $group = '$orig_keys{$key}'",
+ Format => $ARGS{Format},
+ Rows => $ARGS{Rows},
+ OrderBy => $ARGS{OrderBy},
+ Order => $ARGS{Order},
+ );
+</%perl>