Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
shekhar_analyti
Specialist
Specialist

Help on set expression with Different Scenarios .

Hi All ,

Need help on set expression with following scenarios .

1) How to Find Number of Customers who Did not Purchase any Item in Year 2015 ?

2) How to Find Number of Customers who Did not Purchase any Item in Year 2015 But have Done Purchase in Year 2016 ?

3) How to Find Customer who Purchased More Number of Items ?

4) How to Find Customer who Purchased More TYPES of Items ?

5) How to Find Number of Customers who have Purchased more than one type of Item in Year 2015 ?

6) How to show item least purchased ?

Also Find sample Attached .

Thanks & Regards

Shekar

19 Replies
vinieme12
Champion III
Champion III

Can't open the App ,using PE 

What is the expression you are using?

In your sample data all customers have purchases in both 2015 and 2016, so i would expect 0 results

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

I've manually removed 2015 sales for two people in the dataset

Load Script:

LOAD Customer,

     Date as DateIS,

     Year(Date) as YearIS,

     Item

FROM

(ooxml, embedded labels, table is Sheet1);

Expression

=count({< Customer ={"=min(TOTAL <Customer> YearIS)=2016"} >} distinct Customer)

Result

257683.JPG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
shekhar_analyti
Specialist
Specialist
Author

Updated excel
pe.PNG

=count({<Customer= p({"=Count({<Year={2016}>} Item)<>0"}) - p({"=Count({<Year={2015}>} Item)=0"})>}Distinct Customer)

shekhar_analyti
Specialist
Specialist
Author

set expression with p and e in needed ... i have goofed up somewhere ..

vinieme12
Champion III
Champion III

even in this excel there are no customers that satisfy the condition of having the first purchase in 2016,

Can you pick one customer as example?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
shekhar_analyti
Specialist
Specialist
Author

Ann Baker  did not purchase anything in 2015 , but in 2016 she purchase refill ..

2015 no purchase.PNG

vinieme12
Champion III
Champion III

See attached, removed few rows for other people as example

257683.JPG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
shekhar_analyti
Specialist
Specialist
Author

Thanks for reply ...

It seems i led to confusion here . Apologies . 

p n e 2.PNG

Actually i was looking for expression which would get me records highlighted in yellow .

For Janet in 2015 Item is null but in 2016 it has lamp .. I was looking for such records .
p n e 4.PNG

Thanks & Regards

Shekar

vinieme12
Champion III
Champion III

Try below Customers with null items in 2015 but with possible items in 2016

=count({< Customer = {"=count({<YearIS={2015}>} Item)=0"}> * <Customer = {"=count({<YearIS={2016}>} Item)>0"}>}distinct Customer)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
sunny_talwar

In a single set analysis... may be like this

=Count(DISTINCT {< Customer = {"=Count({<YearIS = {2015}>} Item) = 0 and Count({<YearIS = {2016}>} Item)>0"}>} Customer)