Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear QV users,
I am trying to group my table. Before doing this I would like to ad sum() to some fields that are going to be grouped in values. See attachment 'forum qv'. When running this script I am receiving the following script failure (see attachement 'forum qv failure') Cann someone help me explain what is wrong here??
regards,
Aissam
Hi,
You must use group by statement when you use sum() in load.
You must include all the field except the sum() in your group statement.
Just like below.
Load
A,
B,
sum(c) as C
Resident XXX
Group by A,B;
Regards,
Kaushik Solanki
I don't think you can use sum() in the script...
Hi,
Have you given the group by clause in your script?
Not yet, trying first to create the sum function..
Aissam
You must use Group By with an aggregate function like sum(). Use the following syntax
LOAD Key,
Value,
Sum(Amount) AS TotalAmount
Resident MyTable
Group by Key, Value;
The group by statement should contain all the fields in the query that are not in an aggregate function. The field names must be the source table names.
Hope that helps
Jonathan
Hi,
You must use group by statement when you use sum() in load.
You must include all the field except the sum() in your group statement.
Just like below.
Load
A,
B,
sum(c) as C
Resident XXX
Group by A,B;
Regards,
Kaushik Solanki
Thanks guys,
It worked.
With kind regards,
Aissam
Hi,
Can you please mark this post as Answered. So that Qlikview Group can look at the other post too.
Regards,
Kaushik Solanki