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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

XML file data input, modification and uotput

Suppose an organization pays their employees on a monthly basis. The salary of each
of its employees is tallied in an XML file for each month. According to the new requirements, the
new software must perform following things:
a) If an employee is not present during a month award them zero salaries.
b) If a particular month is not present in the salary XML file, award zero salaries
for that as well.

Labels (3)
3 Replies
Anonymous
Not applicable
Author

Do you want to generate a new XML file? What are you expected result? Can you show us an example output based on your input file?

Regards
Shong
Anonymous
Not applicable
Author

Hi Shong,

 

I want to generate XML file with added data.

XML file attached with the post(Once again attached to this post). Sample is as below. In below file there are only 6 months for employee. I want add remaining months(Total 12 months) and add zero salary to those months.

<Employees>
<EMP_NAME1>K</EMP_NAME1>
<Employee>
<EMP_ID>101</EMP_ID>
<EMP_NAME>Henry Mark</EMP_NAME>
<EMP_PROJECT_ID>P123</EMP_PROJECT_ID>
<SALARY>

<YEARLY Id="2013">
<MONTHLY>
<MONTH Id="1" Sal="60000"/>268600
<MONTH Id="2" Sal="20600"/>
<MONTH Id="3" Sal="26000"/>
<MONTH Id="4" Sal="67000"/>
<MONTH Id="5" Sal="68000"/>
<MONTH Id="6" Sal="27000"/>
</MONTHLY>
</YEARLY>
<YEARLY Id="2014">
<MONTHLY>
<MONTH Id="4" Sal="80000"/>
<MONTH Id="5" Sal="12000"/>
<MONTH Id="7" Sal="20000"/>
<MONTH Id="8" Sal="20000"/>
<MONTH Id="9" Sal="28000"/>
<MONTH Id="10" Sal="29000"/>
</MONTHLY>

 


EmployeeSalary.xml
Anonymous
Not applicable
Author

Hi

See below scenario, it creates a new XML file based on your input example XML file, it adds new monthly salary element and set salary as 0 if it is not found in the source file. 0683p000009M844.png0683p000009M8HC.png

0683p000009M82y.png0683p000009M85R.png0683p000009M8HM.png0683p000009M8HW.png0683p000009M6xM.png

Hope it helps and let me know if you have any questions.

 

Regards

Shong


new_employee_salary.xml