Discussion board where members can learn more about Qlik Sense App Development and Usage.
Let me start by saying that I'm really new to qlik and it's also not my usual field of work so sorry if this feels trivial.
I'm using Qlik Sense Cloud version fyi.
I want to count the number of orders from returning customers vs new ones.
For that I have a date of order (order_created_at) and a date of account creation for each customer (account_created_at).
To calculate the KPI number of orders, I basically count the order this way
count (distinct order_id)
To calculate the KPI new customers, I would want to do exactly the same only if the dates are matching.
if ( date(order_created_at) = date (account_created_at), then count (distinct order_id))
This tells me there is an error so I tried also the following:
if ( $(order_created_at) = $(account_created_at), then count (distinct order_id))
There is no longer an error but it doesn't count anything as if the condition was never meant.
Trying to read resources I'am a bit lost on how to proceed.
I tried to use tables and variables to find my way around but without success so far.
If anyone understands what I'm trying to achieve and have a solution it would be most welcomed.
Go to Solution.
Make sure order_created_at and account_created_at are real date fields and not text values and then try this expression:
count (distinct if( order_created_at=account_created_at, order_id))
I read so many posts on the IF function and never saw anything like your suggestion.
It works perfectly!
Great. Glad to hear it solved your problem. Would you mind marking this discussion as answered?