Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

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
Partner
Partner

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
Partner
Partner

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

Contributor II
Contributor II

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