Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to do logical judgement with component

Hi Guys,

 

I have a xml data like below. I am using tExtractXMLField to extract xml to a row. But tExtractXMLField is only able to set one loop xpath query option, that means if I use /xml/header  to get errcode  and then I am not able to get the fields under xpath /xml/content/group. 

My case is do different operation according to errcode.  

Who can tell me how to design this?

Thanks in advance!

<xml>
  <header>
    <errcode>ERR000</errcode>
    <msg>success</msg>
  </header>
  <content>
    <group>
      <creationtime>2016-03-22 13:35:46</creationtime>
      <pk_supplier>1001QW10000000004CT2</pk_supplier>
      <vbillcode>CD2016032200000001</vbillcode>
      <modifiedtime>2016-03-22 13:36:17</modifiedtime>
      <billmaker>1001QW1000000000017S</billmaker>
    </group>
    <group>
      <creationtime>2016-03-23 16:05:30</creationtime>
      <pk_supplier>1001QW10000000004CRS</pk_supplier>
      <vbillcode>CD2016032300000006</vbillcode>
      <modifiedtime>null</modifiedtime>
      <billmaker>1001QW1000000000BT8L</billmaker>
    </group>
  </content>
</xml>

If error occurs , the response is like below

<xml>
  <header>
    <errcode>ERR001</errcode>
    <msg>something wrong</msg>
  </header>
<xml>

 

I 'd like to add if judgement after a extract errcode from xml, if the errcode equals err000 then extract the fields under xpath /xml/content/group to activemq , else just log it.

 

 

 

Labels (2)
2 Replies
fdenis
Master
Master

you may cascase loop on multiples tXmlMap using document to transfert Xml element
Anonymous
Not applicable
Author

Hi Francois, Yeah agree with you, for now tExtractXMLField already convert xml string to document so that i can get the xml field in a row. Could you give some detail teach me how to make "if" judgement , like "run if "