reporting services - SSRS RowNumber counting a Groups in the report sequentially -


here need achieve. import purchasing system.

created ssrs report works fine. im missing 1 more step finish it. i'll try explain achieved , remains achieved.

achieved:

lineidlnarr2

 1      751
 1      793
 1      804
 2      804
 3      804
 4      804
 1      807
 2      807
 3      807

the avobe 4 payments. payment id represented by: "lnarr2" (751, 793, 804 , 807). "lineid" counts number of lines pertaining group (purchase)

in ssrs achieved by

  1. creating group, name: "lnarr2_grp" , group on: "lnarr2"
  2. expression "lineid" =rownumber("lnarr2_grp")

remains achieved

following on example above. need add document id (docid). similar lineid represented follows:

docidlineidlnarr2

 1     1      751
 2     1      793
 3     1      804
 3     2      804
 3     3      804
 3     4      804
 4     1      807
 4     2      807
 4     3      807

the above indicates that:

  • document id "1" has 1 description line
  • document id "3" has 4 lines in description

question: expression "docid"? sequential count per group per example above?

thanks in advance

something this?

declare @t table (lineid int, lnarr2 int) insert @t values ( 1 ,     751 ), ( 1 ,     793 ), ( 1 ,     804 ), ( 2 ,     804 ), ( 3 ,     804 ),  (4 ,     804 ),  (1 ,     807 ),  (2 ,     807 ),  (3 ,     807 )   select  s.docid,t.lineid,t.lnarr2    @t t join (select lnarr2, row_number() on (order lnarr2) docid @t group lnarr2) s on      s.lnarr2 = t.lnarr2 

Comments

Popular posts from this blog

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

wordpress - (T_ENDFOREACH) php error -

html - Fade out of a Mp3 song using javascript -