
Re: Count total distinct problem
Manish Kachhia Feb 27, 2014 10:15 AM (in response to Tomasz Zagdan)time is your cyclic group?
if yes, use like below...
count(distinct(StoreID))
/
count( total distinct (<$(=GetCurrentField(TIME)> StoreID))
Re: Count total distinct problem
Tomasz Zagdan Feb 27, 2014 10:24 AM (in response to Manish Kachhia )Yes its a cyclic group but doesn't seem to work..


Re: Count total distinct problem
NAGA CHIRANJEEVI THOTA Feb 27, 2014 10:21 AM (in response to Tomasz Zagdan)count(distinct(StoreID))
/count(distinct total<TIME> StoreID)

Re: Count total distinct problem
Tomasz Zagdan Feb 27, 2014 10:24 AM (in response to NAGA CHIRANJEEVI THOTA)This one gives always 100% result


Re: Count total distinct problem
Manish Kachhia Feb 27, 2014 10:26 AM (in response to Tomasz Zagdan)Have you tried below?
count(distinct(StoreID))
/
count(Distinct Total (<$(=GetCurrentField(TIME)> StoreID))
Re: Count total distinct problem
Tomasz Zagdan Feb 27, 2014 10:29 AM (in response to Manish Kachhia )yes, also no result it just doesn't show anything. Also fields after $ sign are grey. Should they?

Re: Count total distinct problem
Oleg Troyansky Feb 27, 2014 4:14 PM (in response to Tomasz Zagdan)The correct syntax is:
count(distinct StoreID)
/
count(Distinct Total <[$(=GetCurrentField(TIME))]> StoreID)In order to troubleshoot your expression, turn your chart into a Straight Table (or a Pivot Table) and leave the expression Label empty. You will be able to see exactly how QlikView renders your expression formula.
Oleg Troyansky
Come and learn advanced QlikView techniques from the best:
www.masterssummit.com

Re: Count total distinct problem
Tomasz Zagdan Feb 28, 2014 2:47 AM (in response to Oleg Troyansky )Oleg,
the formula you provided indeed has no errors. However  still no results  no data is being displayed. Perhaps there is a different formula to get the same result?
thanks
Regards
CaptainP

Re: Count total distinct problem
Tomasz Zagdan Feb 28, 2014 3:01 AM (in response to Oleg Troyansky )Oleg,
I have another strange problem  perhaps its a bug that results in not showing the formula you provided.
On my bar chart I have a formula count(distinct(StoreID))
Surpirisingly each product that i click on has different bar colours  this didn't happen before in case of other charts with similar structure
Any ideas on that?
Regards
CaptainP

Re: Count total distinct problem
Manish Kachhia Feb 28, 2014 4:10 AM (in response to Tomasz Zagdan)Dear, I think the answer given by OLEG is OK but if it is not working, you need to upload you sample data or qvw file.
This is the best way to get answer in quick fashion.





Re: Count total distinct problem
Mohit Sharma Feb 28, 2014 4:26 AM (in response to Tomasz Zagdan)Try this
count(distinct(StoreID))
/
count( total<Time> StoreID)
Re: Count total distinct problem
Tomasz Zagdan Feb 28, 2014 4:30 AM (in response to Mohit Sharma)this one always gets result 100%. So no matter what product I click on I always have 100% which is not really the case

Re: Count total distinct problem
Oleg Troyansky Feb 28, 2014 4:57 PM (in response to Tomasz Zagdan)Captain,
I think we've been trying to solve different issues... In our responses, we tried to show you how to calculate the share of the TOTAL, i.e. disregard the dimension value in the denominator.
What you are trying to do is to calculate the percentage of the Store count by product, compared to all the stores in general. So, in addition to disregarding the Dimension values, you want to disregard the selection of the Product. The corresponding formula would be:
count(distinct StoreID)
/
count({<Product = >} Distinct Total <[$(=GetCurrentField(TIME))]> StoreID)This Set Analysis condition will cause the expression to disregard any selections made in the field Product. If you need to disregard any other selections, add them into the list of Modifiers, separated by coma,
Site comment to you and Manish:
DISTINCT is not a function, but rather a qualifier within an aggregation function. Therefore, it doesn't require a set of parenthesis after it. So, instead of :
count(distinct(StoreID))
it's enough to write:
count(distinct StoreID)
The extra set of parenthesis doesn't break the formula but makes it more cluttered and less readable.
cheers,
Oleg Troyansky
www.masterssummit.com

Re: Count total distinct problem
Tomasz Zagdan Mar 10, 2014 2:28 PM (in response to Oleg Troyansky )Oleg,
thank you. Finally an answer that works
Best regards!


