Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Vamsi_T
Contributor
Contributor

Insert a new row with sum of two rows in Load script

Hello All.

I would like to insert a new row ( sum of below rows) for every four rows in the data load script. Is this possible?

Kindly share the working solution...

Regards,

Vamsi

 

Labels (2)
23 Replies
Vamsi_T
Contributor
Contributor
Author

Thank You. This result is not with the group, I would like to keep the added row in the top of it based on date and area.

sunny_talwar

What do you mean? What is not right here?

image.png

Vamsi_T
Contributor
Contributor
Author

Sorry. Everything is Fine with your solution.

Just I found out, Some of the main data are not sorted properly. Can you help me in sorting table based on Date and Area while loading files?

sunny_talwar

What do you mean? Can you elaborate and provide a representative sample

Vamsi_T
Contributor
Contributor
Author

See the attached file, some of the files are not sorted like this. While loading, I would like to sort out all files like in the below figure and then your solution can apply to it.

 

1.PNG

sunny_talwar

Can we use the Area field to may be sort if the values will differ? Otherwise what do say that the First Sum belongs to A2, B2, C2 instead of A1, B1, C1

Vamsi_T
Contributor
Contributor
Author

Actually Not, I need both, because I have the same brand names repeat in the main data.

sunny_talwar

I am not really sure I follow you,  can you take a step back and explain what exactly is going on? I feel like we try to solve one problem and then you come up with another one.... it might be easier to solve all the issues at once if you can figure them all out at once... Provide precisely what you have and precisely what you want from it. That might be the only way I will be able to help, otherwise we will continue to have this discussion forever.

Vamsi_T
Contributor
Contributor
Author

I understand. I got the solution for my post.

Additionally, I am facing another issue. Your Solution is working with sorted fields of files. I am facing an issue without sorted fields of files.

I would like to insert a new row ( sum of below rows) for every four rows ( shown in below image) with the attached file.

Required tableRequired table

sunny_talwar

I understand what you are asking for, but how do I know which Sum belongs to which set of 4 values when it is not grouped together? Is there another field which tells ms which Sum is aligned to which A1, B1, C1?