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: 
Not applicable

sum in script

Hi,

I have several excel files with several tables. Each file and table contains a column Index with a numeric value. For a special application i just want to summarize the index from a specific table in the excelfiles. How can i write this in a script and call this sum something else than sum(Index). Sum(Index) is used in graphs, tables.

/Anders

6 Replies
its_anandrjs

Hi,

As i understand you can use the variables and store sum(Index) there and where ever you want to use it use with the help of variables.

if you have any sample file so share it.

Regards

Anand

its_anandrjs

Hi,

Or i suggested you to use resident table.Please if you have any samnple so provide to me.

HTH

Regards

Anand

Not applicable
Author

If you want to sum fields in a load statement, you have to use a group by clause as part of the load. 

Load

     sum(index) as IndexTotal,

     ...

     ...

From MyTable group By SomeField;

Not applicable
Author

Hi, this is the script i am using. How do i sum the column index in the script? have tried sum(Index) as ..... but it doesent work, perhaps i writing it in the wrong place in the script? suggestions?

Script.jpg

Not applicable
Author

So that script will build the table.  After all the excel files are loaded, you will need to do a resident load with a group by statement.

Load

     Anlaggning,

     sum(index) as totalIndes

Resident data group by Analaggning;

I am guessing on how you want to do the group by. 

Not applicable
Author

Hi,

sorry for late feedback, problem fixed

/Anders