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: 
Not applicable

aggr function on date

Hi  I want to find recency for every customer for that I am using  the following expression,

(Today()-max(((aggr(Date,ClientNumber))))) . But this is giving only one value .Can any one suggest a better way.All I need is to get the maximum transaction date of a particular customer and subtracting it from today's date

5 Replies
its_anandrjs

Can you provide some sample data for this to have a look.

Regards

Anand

sushil353
Master II
Master II

Try this:

Today()-max(aggr(Max(Date),ClientNumber))


HTH

antoniotiman
Master III
Master III

Hi,

Max(Aggr( returns only one value.

If Your dimension is ClientNumber

Expression is

Today()-Max(Date)

Regards,

Antonio

Not applicable
Author

Hi Anand

the sample is like something below

ID     Transaction DAte

1        11th Nov 2016

1         8th Nov   2016

12       7th Oct   2016

1         5th Oct 2016

3         4th Oct 2016

12       12th Oct 2016

antoniotiman
Master III
Master III

Hi,

try

Load ID,Date,
Date(Date#(Replace(Replace(Date,'th','*'),' ',''),'DD*MMMYYYY')) as TDate
Inline [
ID, Date
1 , 11th Nov 2016
1, 8th Nov 2016
12, 7th Oct 2016
1, 5th Oct 2016
3, 4th Oct 2016
12, 12th Oct 2016
]
;

or

However, what is You Transaction Date for 1/2/3 of month ?

Regards,

Antonio