2 Replies Latest reply: Aug 15, 2014 7:36 AM by marie-g RSS

    Pivot table inside <for-each-group> tag in rtf template

    marie-g

      Hello!

       

      I have the following question.

      In my report I need to generate several pivot tables which should be grouped by one of the columns. When I'm trying to do this using standart BI publisher tools, it's working wrong: in my pivot table there is data from another group. To make it more clear here's the xml example:

       

      <DATA_DS>

        <YEAR_GROUP>

           <YEAR_ID>2013</YEAR_ID>

           <MONTH_GROUP>

              <MONTH_ID>201301</MONTH_ID>

              <QNT>3</QNT>

              <YEAR_ID1>2013</YEAR_ID1>

           </MONTH_GROUP>

              <MONTH_GROUP>

              <MONTH_ID>201302</MONTH_ID>

              <QNT>2</QNT>

              <YEAR_ID1>2013</YEAR_ID1>

            </MONTH_GROUP>

        </YEAR_GROUP>

        <YEAR_GROUP>

           <YEAR_ID>2014</YEAR_ID>

           <MONTH_GROUP>

               <MONTH_ID>201401</MONTH_ID>

               <QNT>4</QNT>

               <YEAR_ID1>2014</YEAR_ID1>

           </MONTH_GROUP>

           <MONTH_GROUP>

                <MONTH_ID>201402</MONTH_ID>

                <QNT>5</QNT>

                <YEAR_ID1>2014</YEAR_ID1>

           </MONTH_GROUP>

         </YEAR_GROUP>

      </DATA_DS>

       

      And here is the result that I get with standart BI publisher tool:

      01

       

      But I don't need the year 2014 to be shown under 2013 section and vice versa!

       

      In the template generated there's the following CROSSTAB tag:

       

      <?crosstab:c46043;"//MONTH_GROUP";"MONTH_ID{,o=a,t=t}";"YEAR_ID1{,o=a,t=t}";"QNT";"sum"?>

       

      I was trying to change it inserting 'current-group()' everywhere but it didn't help.

       

      I know how to solve this problem by creating a new template from scratch, but the task is to use BI Publisher word template tool. Is there any solution available?

       

      Thanks!

        • 1. Re: Pivot table inside <for-each-group> tag in rtf template
          Sridhar 1245
          Hi marie-g,

           

                    We are also having same requirement Pivot table in RTF template by group wise like (2013, 2014 ..). you got any solution for this issue.

                   

                     If you got any solution please share.

           

             Thanks

           

          Regards

          Sridhar.V

          • 2. Re: Pivot table inside <for-each-group> tag in rtf template
            marie-g

            Hi, Sridhar!

             

            We got the solution for a little different xml like:

             

            <DATA_DS>

                   <MONTH_GROUP>

                    <MONTH_ID>201301</MONTH_ID>

                    <QNT>3</QNT>

                    <YEAR_ID>2013</YEAR_ID>

                 </MONTH_GROUP>

                    <MONTH_GROUP>

                    <MONTH_ID>201302</MONTH_ID>

                    <QNT>2</QNT>

                    <YEAR_ID>2013</YEAR_ID>

                  </MONTH_GROUP>

                 <MONTH_GROUP>

                     <MONTH_ID>201401</MONTH_ID>

                     <QNT>4</QNT>

                     <YEAR_ID>2014</YEAR_ID>

                 </MONTH_GROUP>

                 <MONTH_GROUP>

                      <MONTH_ID>201402</MONTH_ID>

                      <QNT>5</QNT>

                      <YEAR_ID>2014</YEAR_ID>

                 </MONTH_GROUP>

            </DATA_DS>

             

             

            In the cross tab tag you need to change group name from //MONTH_GROUP to current-group(), so you got the following crosstab tag:

            <?crosstab:c35114;"current-group()";"MONTH_ID

            {,o=a,t=t}";"YEAR_ID{,o=a,t=t}

            ";"QNT";"sum"?>