Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum and Group by

Hi,

I am very new in Qlikview development.

I am trying to do a 'Group by' based on [sales year] and [sales month] to find the monthly Sales of each customer in Script.

But I am getting 'Invalid expression' error on following script.

CustomerMonthlySales:

LOAD

[Customer Number],

[VE Posting Year] AS SalesYear,

[VE Posting Month] AS SalesMonth,

SUM([Sales Amount (Actual)]) AS MonthlySales

Resident Fact Group BY [VE Posting Year],[VE Posting Month]

4 Replies
fernando_tonial
Partner - Specialist
Partner - Specialist

Hi, You need put all field without agregation.

Try this.

CustomerMonthlySales:

LOAD

[Customer Number],

[VE Posting Year] AS SalesYear,

[VE Posting Month] AS SalesMonth,

SUM([Sales Amount (Actual)]) AS MonthlySales

Resident Fact

Group BY [Customer Number],[VE Posting Year],[VE Posting Month];

Best Regards.

Tonial.

Don't Worry, be Qlik.
Not applicable
Author

Thank you very much Tonial. That's worked....

its_anandrjs

You have to include all the field in the Group by that you use

CustomerMonthlySales:

LOAD

[Customer Number],

[VE Posting Year] AS SalesYear,

[VE Posting Month] AS SalesMonth,

SUM([Sales Amount (Actual)]) AS MonthlySales

Resident Fact Group BY

[Customer Number],[VE Posting Year],[VE Posting Month];

Regards

Anand

ashfaq_haseeb
Champion III
Champion III

Hi,

If you need to omit group by then below

CustomerMonthlySales:

LOAD

[Customer Number],

only([VE Posting Year]) AS SalesYear,

only([VE Posting Month]) AS SalesMonth,

SUM([Sales Amount (Actual)]) AS MonthlySales

Resident Fact Group BY

[Customer Number];

Regards

ASHFAQ