Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
skiruthigadevi
Partner - Creator
Partner - Creator

Group by in Qlik

Hello Friends,

Appreciate your time. I have a fact table(weekly table with 104 weeks of data)  with below details 

Fact:

Yearweek,

Qty,

Transaction,

UPC,

customer_Id

from 201901.qvd(qvd); // I have to load all the 104 weeks(last 2 years weeks)

So in the chart, I am trying to find the Transaction which has 1 Qty, Transaction which has 2 Qty  and Transaction which has 3+ Qty with the expression below 

Count(Aggr(If(Sum({<_yearweek=[State_Current]::[_yearweek]>} Qty)=1, 1), Transaction))

Count(Aggr(If(Sum({<_yearweek=[State_Current]::[_yearweek]>} Qty)=2, 1), Transaction))

Count(Aggr(If(Sum({<_yearweek=[State_Current]::[_yearweek]>} Qty)>=3, 1), Transaction))

with the Yearweek as my dimension.

the performance is too slow in the chart when I try to select more year weeks., can we try group by in script to achieve the same?

could you kindly let me know your suggestions?

thank you!

2 Replies
Brett_Bleess
Former Employee
Former Employee

Kiruthigadevi, may need to attach a sample app on this one, so folks can check out the data model and everything...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
skiruthigadevi
Partner - Creator
Partner - Creator
Author

Hello Brett,

Thank you, sure. Basically I am trying to do a basket analysis for transactions  in Qliksense.

I have my product hierarchy with 6 levels and the most granular is upc. I am using the below expression 

Count(Aggr(If(Sum(Qty)=1, 1), Transaction))

Count(Aggr(If(Sum(Qty)=2, 1), Transaction))

Count(Aggr(If(Sum(Qty)>=3, 1), Transaction))

 

I am looking for an alternative in the script as my data set is pretty huge

thank you!