Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

exclude Value report in chart

CustomerIdName
1A
2b
3c
4d
ProductIdCustomerIdInvoice_Date
prod_1101-01-2016
prod_2201-01-2018
prod_3305-06-2016
prod_4110-01-2018
prod_5405-07-2017

I have two tables  one is Customer and another one is product table,I need to get Active and Inactive Customer Report

The Rules for Active and Inactive are

1.The customer who bought product which is less than a year from the current date is considered to be Active

2. The customer who bought product which is more than a year from the current date is considered to be Inactive

Result Chart:

Total no of Active Customer is 3

Total no of Inactive Customer is 1

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try something like:

Active:

=Count( Distinct {<CustomerId={"=Addyears(Max(Date),1)>=Today()"}>} CustomerId)

Inactive:

=Count( Distinct {<CustomerId={"=Addyears(Max(Date),1)<Today()"}>} CustomerId)

Capture.JPG

View solution in original post

1 Reply
tresesco
MVP
MVP

Try something like:

Active:

=Count( Distinct {<CustomerId={"=Addyears(Max(Date),1)>=Today()"}>} CustomerId)

Inactive:

=Count( Distinct {<CustomerId={"=Addyears(Max(Date),1)<Today()"}>} CustomerId)

Capture.JPG