gives me the total of same name (say7), what i need is the 1of7, 2of7, 3of7 etc. I need that count.
I think you should rephrase that, and/or give a practical example; I for one have no idea what that means.
This is easiest to achieve with a recursive custom function. Pass a parameter of the current record's primary key and the current recursive depth, starting with 1. The custom function will use the GetNthRecord function to grab the value of the related record's primary key; if it matches what is passed in then return the recursive depth.
Something like this:
DepthFunction ( _keyVal ; _max ; _depth ) =
_depth > _max ; -1 ;
GetNthRecord ( SelfJoin_Rhododon::<primary key field> ; _depth ) = _keyVal ; _depth ;
DepthFunction ( _keyVal ; _max ; _depth + 1 )
The _max value is in there so that we don't go through unnecessary recursion and perhaps error out by going too far.
You would call this function in your calculation field where you want the "out of" value to appear:
_outof = Count ( SelfJoin_Rhododon::Name ) ;
_result = DepthFunction ( <primary key field> ; _outof ; 1 )
Case ( _result = -1 ; "<Error>" ; _result & " of " & _outof )
(have as a text result rather than a number result)