Information générale
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
>Hi,
>
>I need to create a variable in a report that will count the number of distinct values. For example, if the report has a column EMPLOYEE_ID the variable should count how many employees are in the report. How? I tried to enter in the value to store "DISTINCT( EMPLOYEE_ID )" but it gives me error. TIA for any help.
The key to any task like this is using two variables, one to track the changing value and one to do the counting. Typically, you want to set them up with the counter first and the tracker second, along these lines:
Name: nEmployees
Initial value: 0
Value to store: IIF(Employee_ID = nLastEmpID, 0, 1)
Calculate: Sum
Name: nLastEmpID
Initial value: {some value that can't occur in the data}
Value to store: Employee_ID
Calculate: None
Tamar
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement