Distinct Data Set with xml source?

PhilippArndt
edited February 11, 2022 in Analytics #1
Hello,<br />
I need to have a distinct table for the following xml data source:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<?xml version="1.0" encoding="iso-8859-1"?>
<A>
[b]
<D>1</D>
<E>1234</E>
[/b]
</A>
<A>
[b]
<D>2</D>
<E>4321</E>
[/b]
</A>
<A>
[b]
<D>2</D>
<E>4321</E>
[/b]
</A>
<A>
[b]
<D>1</D>
<E>1234</E>
[/b]
</A>
</pre>
<br />
<br />
The Result should be a table like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
| 1 | 1234 |
| 2 | 4321 |
</pre>
How can I do this with BIRT?

Comments

  • averma
    edited December 31, 1969 #2
    Hi PhilippArndt:
    You XML file is malformed, you are missing the root element. I have modified the data to fix the issue and I am attaching a sample report that uses this file. The report design expects the file in C:temp.
    Hope this helps.

    Ashwini
    Warning No formatter is installed for the format ipb
  • PhilippArndt
    edited December 31, 1969 #3
    thanks, the root node is really missing in my sample. But this is not the problem. Your sample returns a table:<br />
    <pre class='_prettyXprint _lang-auto _linenums:0'>
    | 1 | 1234 |
    | 2 | 4321 |
    | 2 | 4321 |
    | 1 | 1234 |
    </pre>
    <br />
    But it should only contain two elements (for example D as unique key).<br />
    The result should be:<br />
    <pre class='_prettyXprint _lang-auto _linenums:0'>
    | 1 | 1234 |
    | 2 | 4321 |
    </pre>
    <br />
    <pre class='_prettyXprint _lang-auto _linenums:0'>
    <?xml version="1.0" encoding="iso-8859-1"?>
    <F>
    <A>
    [b]
    <D>1</D>
    <E>1234</E>
    [/b]
    </A>
    <A>
    [b]
    <D>2</D>
    <E>4321</E>
    [/b]
    </A>
    <A>
    [b]
    <D>2</D>
    <E>4321</E>
    [/b]
    </A>
    <A>
    [b]
    <D>1</D>
    <E>1234</E>
    [/b]
    </A>
    </F>
    </pre>
  • averma
    edited December 31, 1969 #4
    Hi PhilippArndt:
    For this I would recommend using scripted data source.

    Ashwini
    Warning No formatter is installed for the format ipb