How to count unique values

emagnun April 21, 2021

I have a table that lists release against product. One release can include multiple products. I want to get the total number of releases. But the count that I get in pivot table is the total number of rows (i.e. total number of products shipped).

1) How to display the count of releases as 2, coz I have only 2 releases Rel-A and Rel-B ??
2) In the below table, how can I change the header "Count" to "Product Count" ?
capture.JPG

 

 

1 answer

2 votes
Katerina Kovriga _Stiltsoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2021

Hi @emagnun ,

For the first case use the following settings for your Pivot Table macro:

Thu 7-1.png

Thu 7-2.png

To change your headers, wrap your Pivot Table macro into the Table Transformer macro and apply your custom SQL query:

Thu 7-3.png

Thu 7-4.png

SELECT T1.'Release' AS 'My Release',
T1.'Count' AS 'Count of My Releases'
FROM T*

Thu 7-5.png

Hope this helps.

emagnun April 22, 2021

Thanks @Katerina Kovriga _Stiltsoft_ , for the reply.

#1 ) But, it still doesn't give the "count of releases". As you can see I have 2 releases only (Rel-A and Rel-B). How do I get to display the count of releases "2"? The pivot table shows "4" which is actually the total number of products in releases Rel-A and Rel-B combined.  

capture.JPG

Katerina Kovriga _Stiltsoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2021

For such case you should use the Table Transformer macro:

Thu 7-6.png

Thu 7-7.png

SELECT
COUNT (DISTINCT (T1.'Release')) AS 'Number of releases'
FROM T*

Thu 7-8.png

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events