Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Read data from database XML field

Hi all, Is it possible to read data from database field with XML type?

8 Replies
christophebrault
Specialist
Specialist

Hi,

Yes it's possible. Add a new table from a file, select your xml file and select XML if Qlikview doesn't recognize it.

You also can load XML from web API.

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
Anonymous
Not applicable
Author

Thanks Christopher, But is it possibe to read data from the database from field with XML data type? For example i have a table in the SQL Server, like CustomerInfo:

Customer (varchar 40)

Info (xml)

Info value:

<customer id = 111>

<address>aaaaa</address>

<position>bbbb</position>

</customer>

From the example above I need to get data from address and position attributes...

Not applicable
Author

Hi Konstantin,

I just use TextBetween function to return whatever is between '<address>' and '</address>' and use it as a field.  Turns the db:

CustomerXML
111<customer id = 111>
<address>aaaa</address>
<position>bbbb</position>
</customer>
112<customer id = 112>
<address>cccc</address>
<position>dddd</position>
</customer>

into straight table:

CustomerAddressPosition
111aaaabbbb
112ccccdddd
amien
Specialist
Specialist

anyone got this working? i too have a xml field in a database and want to extract some data.

I know TEXTBETWEEN, but with this, you first have to get the whole xml field over using SQL SELECT.

I would like to get my text right in the SQL SELECT. This is much more efficient.

I checked google, but we are on ODBC level here. So not all SQL statements are possible.

Not applicable
Author

did you ever get an answer to this question?

amien
Specialist
Specialist

Nope .. still looking for the answer .. Don't have solution or workaround yet

Not applicable
Author

Thanks for the reply.

Not applicable
Author

Access the menu script and search for the file by the command "FILES TABLE", load only one file so that the structure QLIKVIEW read this file and create a map. If other files have different fields, add these fields using as reference the map created in the script.

Change the the file path excluding the file name and indicate only the destination folder of all files to be loaded with the expression \ *. Xml.

If the file contains more than one table that requires connection, using the file name to create a key between the tables:

FileName (FILE) as key.