Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
I have small doubt.
Is there any other function to get the distinct count output?
Ex:count(distinct sales)=100
the sam eoutput shud come witout usng distinct?
Any suggestions?
Thanks In advance.
In the script,
You can use
LOAD Count( DISTINCT FieldName) AS DistinctFieldNameCount
RESIDENT YourTable;
[Note: That will count only FieldName in one table, so if FieldName is a key, this may differ from the other methods]
Or as field function:
Let vDistinctFieldName = FieldValueCount( 'FieldName');
If you create a straight table chart with dimension FieldName,
=RowNo(TOTAL)
will return the distinct count as well in each line.
There probably more methods to get someway or another a distinct count, but the common way is just a
=Count( Distinct FieldName)
Have not tested, but may be this:
Count(Aggr(Count(Sales), Sales))
Sample:
Table:
LOAD * Inline [
Sales
10
15
20
32
10
15
];
What is your doubt concerning using
Count(Distinct FieldName)
?
What Sunny suggested works, but I see no advantage in using this?
A common practice is to create a field CounterOfFieldName in your dimensional table (that holds the distinct values of FieldName) just containing 1, then do a
=Sum(CounterOfFieldName)
Read also
thnx sunny and swuehl.....
no use of that just want to know ...
and i want to get count and with in that no duplicates? how cn i?
Count(DISTINCT ...) would be the most efficient way to do it I believe.
ohhh is it? can i get usng rowno() or iter() function?
if yes explain bro?
In the script? front end chart? front end text box object?
how to do in script and frnt end aswell?
In the script,
You can use
LOAD Count( DISTINCT FieldName) AS DistinctFieldNameCount
RESIDENT YourTable;
[Note: That will count only FieldName in one table, so if FieldName is a key, this may differ from the other methods]
Or as field function:
Let vDistinctFieldName = FieldValueCount( 'FieldName');
If you create a straight table chart with dimension FieldName,
=RowNo(TOTAL)
will return the distinct count as well in each line.
There probably more methods to get someway or another a distinct count, but the common way is just a
=Count( Distinct FieldName)