Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
manojkulkarni
Partner - Specialist II
Partner - Specialist II

Aggr - Help required

Hi everyone,

I am doing some aggregate at chart level to identify the customer last visit at shop level.

My dimension is Shop Id and expression is to get max transaction date of each user per shop.

I am calculating difference using maximum date at global & maximum date derived from aggregate at user/shop level.

This works only when I add user ID in dimension, but i doesn't want to show userid in dimension.

How this can be solved ?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

You probably missed out 'date format' note. PFA

View solution in original post

21 Replies
manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

can i use something like in expression

Dimension is : ShopID

this is to calculate days gap in shopping. vMaxDate is fixed date.

(vMaxDate - aggr(max(tranDate),CustID,ShopID))

tresesco
MVP
MVP

There would be multiple customers against a shop, hence multiple max dates/differences for them. How would would like to see those differences agains one shopid? Concatenated or summed up?

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

Exactly, there will be multiple customers for each shop. I want to calculate what this last purchase of each customer per store & get difference w.r.t today's date. Then take the count of customers who's difference is 40 days per store.

tresesco
MVP
MVP

Something like:

Count(

               If(

                         (vMaxDate - aggr(max(tranDate),CustID,ShopID))>40

                         , CustID

                    )

               )

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

I am doing samething, but now working.

tresesco
MVP
MVP

Great ! Now could you please close this thread by marking it correct/helpful?

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

Below is the sample data.

vMaxDate = 2015-03-31

Expected Result:

  

StoreIDCustomers whose Recency became >90 Day
153

Sample Data:

   

ShopIdCustIdtxn_date
1515/9/2013
1516/10/2012
1519/28/2013
15112/29/2014
1526/20/2013
1521/31/2010
1528/20/2013
15211/27/2013
1525/1/2013
1528/3/2013
15212/18/2014
15211/13/2012
1527/5/2010
15312/14/2014
manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

typo mistake, it is not working

mario-sarkis
Creator II
Creator II

hi Manoj,

maybe you need to see the date form that you getting from the aggregate function

vMaxDate and the date u getting from the agrregate fucntion should be the same and in you case i think number should be the format.