Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I am having a silly problem trying to count different companies in a table.
Imagine that I have a table with the following values
| CompanyType | Company |
|---|---|
| Bank | ING Direct |
| Bank | BBVA |
| Telco | Telefonica |
| Insurance | BBVA |
| Insurance | Sanitas |
Note that BBVA appears twice. I need to build a table that counts the distinct companies only once in the whole table. See the desired table:
| CompanyType | Count |
|---|---|
| Bank | 2 |
| Telco | 1 |
| Insurance | 1* |
* I do not want to count BBVA again as it was allready included in the first row.
I had tried many different things using a combination of above and set analysis but I could not make it work.
I will be happy if you can help me to find a solution.
Regards and thanks in advance
After doing some tests, I found one issue. When I select in the table on the top, the value Insurance, it must show in this case the number 2. Because BBVA is not listed in the Bank category as it is not selected.
Regards,
Javier
Hey Javier, Its really interesting. I want to ask why you want BBVA into Bank but not in insurance. Can you please explain
Yes it is.
It is because customer needs. The KPI "# Companies" is very important for them and is is defined like that. It means that the same company cannot be counted more than once in the whole table, even it belongs to several CompanyTypes. It has to be counted only in the first appeareance.
Hope it helps.
Regards,
Javier
Well I got what you want. I am sorry I didn't explain my question. Is it necessary that every company falls in bank first not in insurance?
Hi Javier,
I have used Bill Application with conditional Expression.
see the Chart in Green Background it will work with Multiple Selections as well.
Hope this will work
It is no mandatory to fall in Bank first. It is mandatory to fall in the first one that appears in the table, Bank or Insurance. It the table is ordered differently, the row values can be affected... But not the total.
Javier Riera | Director
Tel: +34 916 369 854
Móvil: +34 616 935 130
Keyrus | www.keyrus.es<http://eyrus.es>
El 29/09/2013, a las 17:29, "aamir225" <qcwebmaster@qlik.com<mailto:qcwebmaster@qlik.com>> escribió:
QlikCommunity<http://community.qlik.com/>
HELP: Count number of companies once in table
reply from aamir225<http://community.qlik.com/people/aamir225?et=watches.email.thread> in App Development - View the full discussion<http://community.qlik.com/message/398571?et=watches.email.thread#398571>
Javier
Rohit is getting closer, as in it looks ok for either 1 or all CompanyType 's selected, but not when 2 CompanyType 's are selected.
I think [hope?] I now understand what you after, as in something a bit like a Single Transferable Vote. Where the load order defines for each Company the preference order of the CompanyType. And the row to be counted for each CompanyType is most preferred one [and only only that row] for the CompanyType selected.
I make no guarantees, but it looks promising - and is a simpler more elegant solution.
If you test it as ok with your 5 data rows, could you also test it with more data rows just in case some date permutation breaks it.
Best Regards, Bill
Thanks!
I did some testing and I found that if I select Insurance and Telco, #Companies for insurance must be 2, and it is showing 1 (due the condition you've implemented).
I am still trying... this seems to be a not easy one!
Thanks anyway for your support
Javier,
I'm posting the file again, see if you can open it now. And in this way solves your problem. I used a grouping by company and efetuei counting on this group.
Javier
Have checked out the qvw I posted Sep 30, 2013 12:27 PM ? It may well be what you are after .
It got well delayed by the moderation ?
Best Regards, Bill