reporting services - SQL Server Report Builder - Show Count of Sub Groups -


i have sql server reporting services report shows customer order data, it's grouped follows:

store     customer         customer order items 

so, each report grouping of stores, subgroup of customers per store, , items per customer. i'm trying show aggregate sale , other information @ each header record of appropriate group in report. of working well, each store header record, want show count of customers. i'm trying use variation and\or combination of rowcount, countdistinct , other aggregate functions, no avail.

can me determine how can "count" of customer groups show @ store level header? tia!

countdistinct on customer should work fine - no need specify scope if it's in store group header row.

i put simple test together.

data:

enter image description here

report in designer:

enter image description here

most important thing note countdistinct on customer in store header row; expression used:

=countdistinct(fields!customer.value) 

end result, showing correct values:

enter image description here

please let me know if i'm missing something.

edit after comment:

apologies in advance how long getting.

the previous report did have row groups store , customer, i've modified make more clear, hopefully. still based on same dataset:

enter image description here

you can see there 3 row groups, , each row in report group header row belonging 1 of groups.

in store group header row i've kept same countdistinct expression. i've added countrows() expression show how many actual rows available in each of different groups.

enter image description here

here can see store1, countrows returning 4, i.e. there 4 rows aggregating in scope, expect looking @ dataset.

similarly, when apply =countdistinct(fields!customer.value) in store scope considering these same 4 rows, , see 2 distinct customers store1, seems correct me.

for store2 considering 6 rows in total, have 3 distinct customers. again, applying =countdistinct(fields!customer.value) correct value.

hopefully rejigged report helps clear things up. if i'm still not getting requirements, can please explain numbers wrong in sample report based on sample dataset? way can adjust things on side.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -