Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using aggr function in qlik view

Dear Experts ,

My requirement looks simple ,but am i new to qlik view , struggling with below points . please help me .

I am designing new customer report . i want to show list of customer  based on customer booking date .

when the customer should not have any booking for the past 6 months before (from date)  and customer available between my selection date , then we consider it as new customer .

In my example my date selection is from 1st jan 2015 - 30 jan 2015 .

i want to show customer in dimension and booking_date , origin , segment in expression as it is liked below sample output .

in my example i have taken customer A,B,C,D,E,F , below is an sample output  where customer D and F is not an new customer . customer D booking date is not in between of my selection date and customer F booking date is between of selection date but its available with in 6 months before from date .

i have attached qvd , please guide me .

 

Customer Booking DateSegmentOrigin



























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































A20/01/1504,05Bangalore , Mumbai
B30/01/154chennai,delhi
C20/01/152Ludhiana
E21/01/154Malayasia

Please suggest .

11 Replies
Not applicable
Author

Dear Gysbert ,

Thanks a lot for your help .

Could you please explain me how this expression is working , it will exclude all the customer based on condition ?

=date(aggr(

Max({<

  Booking_date={">=$(vFromDate)<=$(vToDate)"},

  Customer=e({<Booking_date={">=$(=num(addmonths($(vFromDate),-6)))<$(vFromDate)"}>}Customer)

  >} Booking_date)

,Customer),'DD-MMM-YYYY')

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Customer=e({<Booking_date={">=$(=num(addmonths($(vFromDate),-6)))<$(vFromDate)"}>}Customer)

The e() function is to selected excluded values. In this case select those customers that do not have a record with a booking date in the six months preceding the vFromDate date.


talk is cheap, supply exceeds demand