Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Regroup Data in RTF Template

Received Response
454
Views
25
Comments

Summary

Regroup Data in RTF Template

Content

Hello,

I'm working on a template with data that I want to regroup when it is similar.

Example of what I currently have :

I would like to regroup the quantites for SLI---2112 and the quantities for SLI---0770 in order to have only two lines in the synthesis.

Fyi, I currently in my RTF have a For-end loop :

Thanks!

Antoine

«13

Answers

  • timdexter
    timdexter Rank 6 - Analytics Lead

    Hi Antoine

    You need to use a group left layout in word and a for-each-group command to achieve this.

    Word is not great at nested tables which is what you need. Your best approach will be to use the report wizard in the Word BIP plugin. It will get you the layout and the fields you need. The plugin does not use nested tables but a series of variables and xpath commands to get the data to summarize correctly by row.

    I would create it outside of the main template first to get it working as needed. You will then need to embed it inside your main template and modify the fields to make it work correctly.

    Its a case of playing with it a little to get it working. If I get time I will try and create a sample for you

    Tim

  • Carlos Carvalho
    Carlos Carvalho Rank 6 - Analytics Lead

    Hello,

    Not sure of what you want exactly.

    The desired final output would be a line with:

    SLI---2112                         11

    and other line with:

    SLI---0770                         46

    ?

    Can you clarify, pls (maybe provide an accurate example).

    Regards

    Carlos

  • Antoine KAIBER
    Antoine KAIBER Rank 6 - Analytics Lead

    Ok thanks, that would be really helpful, I will try to understand what you wrote on my part to start.

    managed BEAN  yes that's exactly what I mean :

    SLI---2112                         11

    and other line with:

    SLI---0770                         46

  • Carlos Carvalho
    Carlos Carvalho Rank 6 - Analytics Lead

    Hello ​,

    Thanks for clarify.

    So if that is the case, you need a sum, not a group(or perhaps the group is only to 'aggregate' the sum of results).

    I do not know if ​ agrees with me, but you would do a query like:

    select item, sum(quantity) from table where 1=1 group by item;

    Although it can also be done in msword.

    If i am seeing the whole thing right...

    Regards,

    Carlos

  • Antoine KAIBER
    Antoine KAIBER Rank 6 - Analytics Lead

    Hello Managed Bean,

    How can I do that on this forum ? I don't see this option :

    But i've seen people do it so this option must exist.

  • Carlos Carvalho
    Carlos Carvalho Rank 6 - Analytics Lead

    Hello ,

    Can you please provide the wordLayout.rtf and sampleData.xml files, pls?

    Regards,

    Carlos

  • Antoine KAIBER
    Antoine KAIBER Rank 6 - Analytics Lead

    I've tried doing this but it doesn't seem to work...

    ​, why can't I use a nested group on word ? I'm currently trying to work on that but can't seem to merge the data...

  • Carlos Carvalho
    Carlos Carvalho Rank 6 - Analytics Lead

    Hello,

    BTW, have a look at: ,it might be helpful.

    Regards,

    Carlos

  • Antoine KAIBER
    Antoine KAIBER Rank 6 - Analytics Lead

    Hello Tim,

    Thanks for you advice on the report wizard, I actually tried using the pivot table as it seems to be more suited.

    I managed to have this result :

    by making this pivot table in my rtf :

    I still have a lot of issues but at least it merges data.

    Some of the issues that this pivot table is causing are that :

    • It merges THU's of the same stop number in case of multi shipment (for example on the screen it's written SLI 0770 = 3  because in stop 1 of shipment A we have 2 SLI 0770 and in shipment B we have 1 SLI 0770.
    • displays all the THU's that are in the shipments, even if there is 0 quantity for the concerned stop (example of the screen where MAN 9136 = 0 because MAN 9136 exists for another stop number)

    • Doesn't calculate small THU's, it currently calculates the number of THU's

    PS: I could send those attachments by mail as I do not have the @attach function in the advanced editor.

  • Antoine KAIBER
    Antoine KAIBER Rank 6 - Analytics Lead

    Because I've tried but I can't manage to make a group by in the SQL, I don't think it's this simple