---
schema_version: "1"
id: fd36cd5249ec259ecfd4d1a738096698856871c47bb4352ccc998ec82d7383bb
title: KnowledgeArticleViewStat
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_knowledgearticleviewstat.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_knowledgearticleviewstat.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: b713e1d37925f305b9f9c56d5985fb49505e22be3e6736e13abec7b636cc0202
description: Provides certain statistics related to the number of views for the specified article across all article types. The view count statistics are for published and archived articles only. View counts for draft articles aren’t tracked. This object is read-only and available in API version 20.0 and later.
---
# KnowledgeArticleViewStat

Provides certain statistics related to the number of views for the specified article across all article types. The view count statistics are for published and archived articles only. View counts for draft articles aren’t tracked. This object is read-only and available in API version 20.0 and later.

Knowledge\_\_ViewStat is derived from this object.

## Supported Calls

describeSObjects(), query(), retrieve()

## Special Access Rules

Knowledge must be enabled in your org. Users must have access to the published and archived versions of an article to retrieve its views. For more information on published and archived article versions, see the PublishStatus field in KnowledgeArticleVersion.

## Fields

| Field Name | Details |
| --- | --- |
| Channel | 
Type

picklist

Properties

Filter, Group, Restricted picklist, Sort

Description

The channel where the article is viewed:

- AllChannels for article views across all channels.
- App for the internal Salesforce Knowledge application.
- Pkb for article views in the public knowledge base.
- Csp for Customer Portal.
- Prm for article view in partner portal.





 |
| NormalizedScore | 

Type

double

Properties

Filter, Nillable, Sort

Description

Article's weighted views in the selected channel. The article with most views has a score of 100. Other article views are then calculated relative to this highest view score. For example, if the best read article has 2000 views and another has 1000. The first one gets a score of 100 while the second gets 50.



 |
| ParentId | 

Type

reference

Properties

Filter, Group, Sort

Description

ID of the viewed article. This corresponds to a KnowledgeArticle record.



 |
| ViewCount | 

Type

int

Properties

Filter, Group, Sort

Description

The number of unique views a published or archived article has received in the selected channel. An article with a high number of views may not always have a high normalized score. The normalized score for an article is calculated based on views over time, with more recent views earning a higher score. This field is available in API version 27.0 and later.



 |

## Usage

Use this object to query or retrieve certain statistics for article views.

Alternatively, client applications can use the article type API Name followed by \_\_ViewStat to query or retrieve most viewed articles from a specific article type.

## SOQL Samples

The following SOQL clause uses KnowledgeArticleViewStat to query all the article views in Salesforce Knowledge and return the related articles:

SELECT Id, NormalizedScore, Parent.Id 
        FROM KnowledgeArticleViewStat where Channel = 'App' 
        ORDER BY NormalizedScore

Use the following clause to restrict your query to Offer articles for the Offer article type:

SELECT Id, NormalizedScore, Parent.Id 
        FROM Offer\_\_ViewStat where Channel = 'App' 
        ORDER BY NormalizedScore

#### See Also

- [KnowledgeArticle](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_knowledgearticle.htm "Provides read-only access to an article and the ability to delete the primary article. This object is available in API version 19.0 and later.")
- [KnowledgeArticleVersion](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_knowledgearticleversion.htm "Provides a global view of standard article fields across all types of articles depending on their version. This object is available in API version 18.0 and later.")
- [KnowledgeArticleVoteStat](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_knowledgearticlevotestat.htm "Provides the weighted rating for the specified article on a scale of 1 to 5 across all article types. This object is read-only and available in API version 20.0 and later.")