Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Replacing Aggr function with similar function in load script

I have a sheet that shows all customers who have bought an item for the first time in the last year.  It also calculates all items that have been sold for the first time in the last year.  It does this by using an aggr(min(docdate), Brand) function for the brands and an aggr(min(docdate), ItemCode) function for the items.  The formulas work, but the problem is that the sheet tends to crash.  I figure it is because the processing power required by running these functions during use of the app is too high, so i figured it would be better to just go ahead and create tables with only the SKUs and Brands that have been invoiced in the last 12 months in the load script instead of virtually using the aggr function.


I have seen help pages suggesting the use of the group by function, but they also state that the fields must reside in the same table.  Item Code and Brand are in one table and DocDate is in another, so that would not work.  Can Group By work here?  If not, is there a workaround or different function that i could use to achieve the same result?

Thank you

1 Solution

Accepted Solutions
OmarBenSalem

maybe sthing like this?

table1:

DocDate,

id,

...

left join(table1)

table2:

Brand,

"Item Code"..

with that will have a single table containing the fields.

you can know do this :

newTable:

load

min(DocDate) as minDate,

Brand,

"Item Code"

resident table1

group by

Brand,

"Item Code";

drop fields

Brand,

"Item Code" from table table1;

hope this helps

View solution in original post

2 Replies
OmarBenSalem

maybe sthing like this?

table1:

DocDate,

id,

...

left join(table1)

table2:

Brand,

"Item Code"..

with that will have a single table containing the fields.

you can know do this :

newTable:

load

min(DocDate) as minDate,

Brand,

"Item Code"

resident table1

group by

Brand,

"Item Code";

drop fields

Brand,

"Item Code" from table table1;

hope this helps

Anonymous
Not applicable
Author

A slightly modified version of this seems to work.  Thank you.