Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI all expert!
I have this set of data,
Contact Person | Contact Number | COMPANY |
---|---|---|
MA | 11111111 | ABC |
MA | 11111111 | DEF |
MA | 22222222 | GHI |
MB | 22222222 | JIL |
MC | 33333333 | MNO |
MD | 33333333 | PQR |
ME | 33333333 | STU |
ME | 33333333 | VWX |
ME | 3333333 | YZA |
I would like to find out the number of cases where same contact person, multiple company. So in this set of data, it will be 2 (MA & ME both represent multiple company).
I would not like to touch my scripting as much as possible. How can I expression in my KPI to show the number of case.
Regards,
Jia
It's :
Count({<contact = {"=Count(Distinct contact&company)>1"}>} DISTINCT contact)
we want to count distinct contact;
So the original expression is count(distinct contact)
Now, we don't want to count all of them but only the contact who has more then a company;
To do so; we create a 'new field' contact&company and count it distinct:
exp: for MD we'll only have MD&PQR : so 1
for ME: we'll have : ME&STE + ME/ VWX +ME&YZA : so 3 > 1 , we count it and so on;
which leads us to 2 contacts;
hope this helps !
Hi,
Please post you expecting output In .xsl or something else.
This is your output?
Thanks,
Hello Jayaseelan,
Thank for ur prompt help, even for my others qns as well.
My expected output for kpi will be
and my expected output in result table will be
Contact Person | Contact Number | COMPANY |
MA | 11111111 | ABC |
MA | 11111111 | DEF |
MA | 22222222 | GHI |
ME | 33333333 | STU |
ME | 33333333 | VWX |
ME | 33333333 | YZA |
Hi,
KPI should be Count({<[Contact Person] = {"=Count(Distinct [Contact Numer] &'_' & COMPANY)>1"}>} DISTINCT [Contact Person])
Table
Dimension - [Contact Person], [Contact Number]
Expression - Only({<[Contact Person] = {"=Count(Distinct [Contact Numer] &'_' & COMPANY)>1"}>} COMPANY)
It's :
Count({<contact = {"=Count(Distinct contact&company)>1"}>} DISTINCT contact)
we want to count distinct contact;
So the original expression is count(distinct contact)
Now, we don't want to count all of them but only the contact who has more then a company;
To do so; we create a 'new field' contact&company and count it distinct:
exp: for MD we'll only have MD&PQR : so 1
for ME: we'll have : ME&STE + ME/ VWX +ME&YZA : so 3 > 1 , we count it and so on;
which leads us to 2 contacts;
hope this helps !
Hi Celambarasan,
could you explain what {"=Count(Distinct [Contact Number] &'_' & COMPANY)>1"} does?
and also if I want to change to same CONTACT NUMBER, multiple company, how do I go around it?
Regards,
Jia
Hi Jia,
I explained already explained the process:
Now to count the numeros existing in different companys, here how you proceed:
Count({<numero = {"=Count(Distinct numero&company)>1"}>} DISTINCT numero)
Hi Omar,
Thank for the clarification!
Yes yes, guess my post was slightly later, thus missing out your explanation before posting.
So the table wise, correct me if I am wrong. instead of count, we want to show the only the result, thus
Only({<[Contact Person] = {"=Count(Distinct [Contact Person] &'_' & COMPANY)>1"}>} COMPANY)?
Hi Jia Sheng Loh,
Use the following expression you will get you answer.
Count({<[Contact Person] = {"=Count(Distinct COMPANY)>1"}>} DISTINCT [Contact Person])
In the above expression we counting the Distinct Company and Checking with the [Contact person] is > 1 and Count the over all Distinct [Contact person].
Thanks,
Hi Jayaseelan,
Seems like the code Celambarasan, Omar and you provided works,
But since Omar came up with Explanation first, I think is fair to choose his as correct answer so that other that tumble upon this question will understand as well.
Ur explanation is correct and helpful too!
Thank you!
Regards,
Jia