Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Calculate Aggregated field then add back to original table.

Hi Guys,

I have a Sales Table with 5 fields:

Order_Number,

Sales_Value,

Sales_Volume,

Country

Region

I've loaded all the records into a table called 'Sales'. Now I want to create an Average price field (region wise). I know how how to aggregate using preceding load and group by:

Country_Sales:

Load*,

Total_Value/Total_Volume As Average_Price;

Load

Country,

Region,

Sum(Sales_Value) As Total_Value,

Sum(Sales_Volume) As Total_Volume

Resident Sales;

Group by Country, Region;

I want to add the field Average_Price back to the first Sales table. But each time I use a Join I get an increase in number of records, what am I doing wrong? Help much appreciated!!

regards,

H

1 Reply
marcus_malinow
Valued Contributor III

Re: Calculate Aggregated field then add back to original table.

Hi Hareesh,

what you're doing looks ok to me.

My only suggestion would be if you have used a QUALIFY statement somewhere in your script.

If not, could you upload a sample of your data to illustrate the issue?

Marcus

Community Browser