Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Rajat1
Partner - Contributor II
Partner - Contributor II

How to calculate intersection in set analysis?

How to Calculate

(number of customers in (current month-2) - (number of customers in (current month-2) * number of customers in (current month-1))) * number of customers in current month

* Represents intersection not multiplication.

How can i solve this in set analysis

where i am having ,

order_processing_date_plan_acv_link this as a date column and 

customer_id this is a customers.

Thanks,

Rajat.

 

Labels (2)
4 Replies
tresesco
MVP
MVP

Hello Rajat,

From syntactical point of view, it would look something like below screenshot.

tresesco_0-1681279595657.png

In set analysis, operator '*' is used for intersection, '-' for exclusion

 

Rajat1
Partner - Contributor II
Partner - Contributor II
Author

Thanks for the quick response but,

This is not working in qliksense saas version and can you please explain what is cust=p is ?

Thanks,

Rajat

 

tresesco
MVP
MVP

If you are doing it right, it should work in saas as well. p(), e() are called element functions in set analysis. Set modifiers with implicit field value definitions | Qlik Help 

Rajat1
Partner - Contributor II
Partner - Contributor II
Author

Hello Tresesco,

=count(distinct{(< customer_key=p ({<order_processing_date_plan_acv_link={"$(= '>='& date(MonthStart(AddMonths(Today(), -2))) & '<' & date(MonthStart(AddMonths(Today(), -1))))"}>})>
- (< customer_key=p ({<order_processing_date_plan_acv_link={"$(= '>='& date(MonthStart(AddMonths(Today(), -2))) & '<' & date(MonthStart(AddMonths(Today(), -1))))"}>})> *
< customer_key=p ({<order_processing_date_plan_acv_link={"$(= '>='& date(MonthStart(Today())) & '<=' & date(Today()))"}>})>)
) * < customer_key=p ({<order_processing_date_plan_acv_link={"$(= '>='& date(MonthStart(Today())) & '<=' & date(Today()))"}>})>
} customer_key)

I wrote this in set analysis It's not showing any error but output is 0 in each row which should not be the case.

So anything i should change in it ?

Thanks, 

Rajat