Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sureshbaabu
Creator III
Creator III

Aggregate function at script level - using QVD

Hello,

I have a requirement to apply a SUM function on certain columns  - group by at a different column.

So, is it possible to use a Aggregate function at script level while importing data from a QVD file. Please share your thoughts.

NOTE: I can't do the aggregation while creating the QVD file (connecting to Database) ;since the columns are coming from different tables

Eg:

Original Script: Load A,B,C,D from test.qvd

Required: Load A, Sum(B) as B1, Sum(C) as C1,D from test.qvd group by A;

Thanks,

Suresh

1 Solution

Accepted Solutions
fernando_tonial
Partner - Specialist
Partner - Specialist

Hi Suresh,

yes it is possible, you should put the group by all fields that are no aggregate function.

Load A, Sum(B) as B1, Sum(C) as C1,D from test.qvd group by A,D;

Best Regards.

Tonial.

Don't Worry, be Qlik.

View solution in original post

7 Replies
fernando_tonial
Partner - Specialist
Partner - Specialist

Hi Suresh,

yes it is possible, you should put the group by all fields that are no aggregate function.

Load A, Sum(B) as B1, Sum(C) as C1,D from test.qvd group by A,D;

Best Regards.

Tonial.

Don't Worry, be Qlik.
nagaiank
Specialist III
Specialist III

Yes, the following script will work.

Load A, Sum(B) as B1, Sum(C) as C1, Sum(D) as D1 from test.qvd group by A;

sureshbaabu
Creator III
Creator III
Author

Hello Tonial,

Thanks for your response. I tested with a sample data and it works having all the un-aggregated columns in group by,

But In my real senario, I have close to 30 cloums that doest have any aggregate function. So, would you suggest using all 30 columns in the group by. Please share your thoughts.

Thank you!!!

sureshbaabu
Creator III
Creator III
Author

Hello Krishnamoorthy,

Thanks for the Response. You Script is correct too, when I have my column D as numeric.

But, few of my columns are having characters, So, I believe having them on Group by will work.

Thanks

fernando_tonial
Partner - Specialist
Partner - Specialist

Hi Suresh,


Yes, it works the same as SQL.
You need to put all columns without aggregate function in group by.

Best Regards.

Tonial.

Don't Worry, be Qlik.
sureshbaabu
Creator III
Creator III
Author

Thanks a lot for the clarification.

Not applicable

hi, Tonial

how to this qvd file in right

Untitled.png