Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Master
Master

How to find out how many same Company buying from Supplier A and B ?

Hi All

Now i need to create a pivot table :-

Dimension = SOURCE , company_ar

Expression :- Sun(total_ar)

And export table to excel , and sort to find out same company in SOURCE = PM AND PW.
It there any way i can do it in expression  in QV ?

Paul Yeo

 

1 Solution

Accepted Solutions
Highlighted
Specialist III
Specialist III

Re: How to find out how many same Company buying from Supplier A and B ?

I could not open your QV. But see my example.

tab1:
LOAD 'Company '& Pick(Ceil(19*Rand()),'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s') As Company,
 	 Round(  1000*Rand()*Rand()) As Sales,
	 'Supplier '& Pick(Ceil(2*Rand()),'A','B') As Supplier
AutoGenerate 25;

Expression:

Only({<Company=p({<Supplier={'Supplier A'}>})*p({<Supplier={'Supplier B'}>})>} Company)

commQV56.PNG

View solution in original post

6 Replies
Highlighted
Master
Master

Re: How to find out how many same Company buying from Supplier A and B ?

Hi All

My QVW

Highlighted
Specialist III
Specialist III

Re: How to find out how many same Company buying from Supplier A and B ?

I could not open your QV. But see my example.

tab1:
LOAD 'Company '& Pick(Ceil(19*Rand()),'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s') As Company,
 	 Round(  1000*Rand()*Rand()) As Sales,
	 'Supplier '& Pick(Ceil(2*Rand()),'A','B') As Supplier
AutoGenerate 25;

Expression:

Only({<Company=p({<Supplier={'Supplier A'}>})*p({<Supplier={'Supplier B'}>})>} Company)

commQV56.PNG

View solution in original post

Highlighted
Master
Master

Re: How to find out how many same Company buying from Supplier A and B ?

Hi Sir

Thank you very much , your expression is very flexible , it all me to add more supplier.

Now I have one more request. that is I have 3 supplier , if any company appear in any 2 supplier , I need to flag the company , it is possible ? instead of company must appear at all 3 company. 

The reasons is if I have 3 supplier , all customer appear in 3 supplier , the listing is very few to meet the criteria.

Paul

Highlighted
Specialist III
Specialist III

Re: How to find out how many same Company buying from Supplier A and B ?

Please try this.

Only({<Company={"=Count(DISTINCT Supplier)>=2"}>} Company)

 

Highlighted
Specialist III
Specialist III

Re: How to find out how many same Company buying from Supplier A and B ?

commQV57.PNG

Highlighted
Master
Master

Re: How to find out how many same Company buying from Supplier A and B ?

Hi All

I move this to top.

Paul