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: 
prahladind9
Partner - Contributor III
Partner - Contributor III

Count using set analysis

Hi,

I need to show the count of customers in qlik sense KPI

To find out the account opened in the last 7 days:

The query which is run on my db is below

select count(a."Customer") from "Casa" a, "DimBranch" b where b."ApplicationDate" >= a."DateTDOpen" AND b."ApplicationDate"- a."DateTDOpen"<=7

result when this query is run on my db >>>14061

set analysis expression used in KPI of sense:

COUNT({$<Customer= {"=ApplicationDate>=DateTDOpen"},

Customer = {"=ApplicationDate-DateTDOpen<=LastXDays"} >} Customer)

query result in qlik sense KPI >>>163

What am i doing wrong ??

4 Replies
migueldelval
Specialist
Specialist

Hi Prahlas,

Try this please and tell me

COUNT({$<ApplicationDate={'>=DateTDOpen'},

ApplicationDate={'<=(DateTDOpen-LastXDays'} >} Customer)

Regards

Miguel del Valle

prahladind9
Partner - Contributor III
Partner - Contributor III
Author

i tried your query as this:

COUNT({$<ApplicationDate={'>=DateTDOpen'},

ApplicationDate={'<=(DateTDOpen-7)'} >} Customer)

LastXDays is hard coded to 7. The count shows 0

Not applicable

Try this

COUNT({$<ApplicationDate={'>=DateTDOpen <=DateTDOpen+LastXDays'} >} Customer)

It's a bit hard to validate the expression to check if it's correct or not. YOu might just have to check the syntax when copy in.

prahladind9
Partner - Contributor III
Partner - Contributor III
Author

I tried your query. The count shows 0