Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
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.
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;
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!!!
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
Hi Suresh,
Yes, it works the same as SQL.
You need to put all columns without aggregate function in group by.
Best Regards.
Tonial.
Thanks a lot for the clarification.
hi, Tonial
how to this qvd file in right