If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

how to do when the two childTabular has different rows?

Started by silywiwi, 27 Aug 2007 08:32:17 PM

Previous topic - Next topic

silywiwi

     Hi;
     I have a requirement that I need to list the score of student and divide score to greater than 80 point and lower than 80 point,and I divide the two type into two child tabular.
     
     I try to illustrate that:
     if one of child is:
    studentName1      score1 
      wiwi                80
      sily                  93
      holy                 86
      messi               91

     another is :
     studentName2    score2
       hoin                78
       gofu                67

    the two child tabular have different rows,when I display them into a list in page,the list looks like below:
    studentName1      score1     studentName2    score2
      wiwi                80                hoin              78
      wiwi                80                gofu              67
      sily                  93                hoin              78
      sily                  93                gofu              67
      holy                 86                hoin              78
      holy                 86                gofu              67
      messi               91                hoin              78
      messi               91                gofu              67

    but I want to the list looks like below :
studentName1      score1     studentName2    score2
      wiwi                80                hoin              78
      sily                  93                gofu              67
      holy                 86     
      messi               91             

how can I do ? 
any suggestion is appreciated
Thanks!

vamsi_yal

take two tab models in the following form
studentName1    score1  studentName2 score2   var
wiwi       80     ' '                      0   1
sily       93     ' '                      0   2
holy       86     ' '                      0   3
messi       91     ' '                      0   4


studentName2 score2  studentName1    score1 var
hoin       78     ' '                      0   1
gofu      67     ' '                      0   2

[I added three extra fields in the two tab models....var is the surrogate key..incremented one in every recore....You can do this using running_count(any dimension)]
Now union both of them and the resultant look like
studentName1    score1  studentName2 score2   var
wiwi       80     ' '                      0   1
sily       93     ' '                      0   2
holy       86     ' '                      0   3
messi       91     ' '                      0   4
hoin       78     ' '                      0   1
gofu      67     ' '                      0   2

Now apply grouping on Var.....and give the aggregate function as max for studentname1 and studentname2...and total for score1 an score2....[max(wiwi,' ') will give wiwi]

studentName1    score1  studentName2 score2   var
wiwi       80    hoin       78   1
sily       93    gofu      67   2
holy       86     ' '                      0   3
messi       91     ' '                      0   4

Now you can hide the var field at the query level....Hope this would answer ur question..
Regards,
Vamsidhar





silywiwi

  Thank you very much for your detailed reply !
    I am a novice ,so i donnot understand something of your word;
,Are the "two tab models" two children tabularmodel?
how can i make the fields be "0" and ""?  how to union the two childrenTab ? union them in parent TabModel?
   one of my childrenTab named children1 is
   dataItem :studentName1 score1
   filter: [score1]>=80
  another named children2 is
   dataItem: studentName2 score1
   filter:[score1]<80
   do I insert studentName2 and score2 into children1?

 
thank you once again!