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: 
marishnagendran
Creator
Creator

Intersection Using P() Function

Hi All,

marishnagendran_0-1685539379286.png

 

The above is my source data & Output data .

Continuously last 2 months if the customer was not buyed(No Sales). Then the customer and product data wants to shown in the table. 

Attached Excel sheet FYR.

Please help me out

OutPut: 

Customer Product
   
Customer A Product A
Customer A Product B
Customer A Product D
Customer B Product A

 

Thanks,

Marish 

 

Labels (4)
2 Replies
vikasmahajan

Hi ,

you can apply  following set :

Dimension : 

Customer & Product 

Measure:

Sum({<  Reason = {"No Sales"}  >} Sales)

or 

Did you try indirect set analysis P() & E() :

https://community.qlik.com/t5/QlikView-App-Dev/Indirect-Set-Analysis/td-p/1300861

https://community.qlik.com/t5/QlikView-App-Dev/P-E-functions/td-p/1346858

https://community.qlik.com/t5/QlikView-App-Dev/P-E-and-where-do-you-use-them/td-p/457847

Hope this help you.

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
tresesco
MVP
MVP

🙂 - I liked the challenge. Thanks for asking the question here.

One of the ways could be like following.

tresesco_1-1685703140162.png

Load *,
MonthName(Month) as MonthName
,Customer&'-'&Product as Cust_Prod
Inline [
Month, Customer, Product, Reason
45039, Customer A, Product A, No Sales
45039, Customer A, Product B, No Sales
45039, Customer A, Product C, Sales
45039, Customer A, Product D, No Sales
45039, Customer B, Product A, No Sales
45039, Customer B, Product B, Sales
45069, Customer A, Product A, No Sales
45069, Customer A, Product B, No Sales
45069, Customer A, Product C, No Sales
45069, Customer A, Product D, No Sales
45069, Customer B, Product A, No Sales
45069, Customer B, Product B, Sales
]

Get the latest two months and use them to find the intersection data set for them.

Only({
<Cust_Prod=p({<Reason={'No Sales'},Month={'$(=Num(AddMonths(Max(Month),-1)))'}>})>
*
<Cust_Prod=p({<Reason={'No Sales'},Month={$(=Max(Month))}>})>
}
Product
)