New Products sold by Customer - Set Analysis with P()/E() function
Hello,
I have the first 3 columns on the left loaded into Qlik Sense.
I am trying to count New Productssold at each Customer in Period 2 (Period 2 is selected in the App) and not sold in Period 1 (by Customer)
For easy visualising let's look at the modified table with the same data on the right: I want to have as a result all the coloured Products (yellow and red) from the Period2 Column (last column), that is 2 Products (4 and 5) for C1 and 3 Products(2,5,6) for C2.
Customer
Period
Product
..............
.............
Customer
Period1
Period2
C1
Period1
Prod1
C1
Prod1
Prod1
C1
Period1
Prod2
C1
Prod2
C1
Period1
Prod3
C1
Prod3
Prod3
C1
Period2
Prod1
C1
Prod4
C1
Period2
Prod3
C1
Prod5
C1
Period2
Prod4
C2
Prod1
Prod1
C1
Period2
Prod5
C2
Prod2
C2
Period1
Prod1
C2
Prod3
Prod3
C2
Period1
Prod3
C2
Prod4
C2
Period1
Prod4
C2
Prod5
C2
Period2
Prod1
C2
Prod6
C2
Period2
Prod2
C2
Period2
Prod3
C2
Period2
Prod5
C2
Period2
Prod6
I am using the next espression in a table with Customer as dimension:
Count({<Product=E({<Period={'Period1'}>})>}Distinct Product) or
How can I make this expression not to disregard that I am interested in Products not Sold in Period 1 in the specific Customer in that row/or Aggr, not in any Customer in the app.
Another question would be if '=E(...)' and '-=P(...)' has the same effect ?
I have attached sample app and data.
PS I can get the desired result Counting distinct products from both Periods - Count distinct Products in Period1, but I would like to know why my Expression with E()/P() function is not working and how I can make it work (if possible).