Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

source us XML file

Hi Experts,

Anyone having a QVW along with XML file ? If yes, could you please share to me..

I tried reading from a XML. But it displays data to a single records.Where as my XML file contains 100 records.

Hope some one will understand the issue I am facing.

Regards,

^

Tags (2)
8 Replies

Re: source us XML file

We might be able to understand the issue you are facing if we knew where to look.

XML files can be mightily different since the language itself allows for extreme customization, even programming.

The best thing you can do is post your XML file (or a sample) here so that we can get you a QV model that is able to read its content.

Best,

Peter

Employee
Employee

Re: source us XML file

It sounds like you are only reading in the definition and not the data itself. When you are importing the XML are you seeing two tables in the File Wizard? If so, one of them should contain the data and this will be visible in the preview window. When you select this table and Finish the wizard it should set up the load script to load the fields and also create a second table for the definitions.

ramkrishna86
Contributor II

Re: source us XML file

Use data transformation in qlikview while loading data from XML file.

Not applicable

Re: source us XML file

<?xml version="1.0" encoding="UTF-8"?>

<data>

   <A>

      <id>1</id>

      <contact_id/>

      <status>Deleted</status>

   </A>

   <B>

      <id>2</id>

      <contact_id/>

      <status>Open</status>

   </B>

   <C>

      <id>3</id>

      <contact_id/>

      <status>Complete</status>

   </C>

</data>

Above is XML file content. When tried to read in Qlikview able to see the below.

xml_issue.jpg

But actually it is (To My knowledge) supposed to be 2 columns(ID,STATUS) with 2 records.

Hope I explained the scenario in an understandable way.

Employee
Employee

Re: source us XML file

I'm no expert in XML but from my understanding of it the <A>,<B> and <C> tags are what is causing the problem here. You can see from the Fields list that you are getting 'A/id', 'B/id' and 'C/id' instead of an ID field containing all three values. They are being translated as three different types of container instead of three versions of the same container.

If you created this XML yourself then you may want to check the formatting. If you received it from somewhere else there might be a document definition that will help QlikView understand the structure.

VishalWaghole
Valued Contributor II

Re: source us XML file

Hi Consultant QV,

Your XML file should be like this,

<?xml version="1.0" encoding="UTF-8"?>

<data>

  <A>

      <id>1</id>

      <contact_id/>

      <status>Deleted</status>

  </A>

  <A>

      <id>2</id>

      <contact_id/>

      <status>Open</status>

  </A>

  <A>

      <id>3</id>

      <contact_id/>

      <status>Complete</status>

  </A>

</data>

Your tags A,B and C was wrong......

- Regards,

Vishal Waghole

senpradip007
Valued Contributor III

Re: source us XML file

Try this

<?xml version="1.0" encoding="UTF-8"?>

<data>

<DT>

   <A>

      <id>1</id>

      <contact_id/>

      <status>Deleted</status>

   </A>

</DT>

<DT>  

   <B>

      <id>2</id>

      <contact_id/>

      <status>Open</status>

   </B>

</DT>

<DT>  

  <C>

      <id>3</id>

      <contact_id/>

      <status>Complete</status>

   </C>

</DT>

</data>

Not applicable

Re: source us XML file

Thanks VishalWaghole. I hope it is  you are perfect !