Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
gireesh1216
Creator II
Creator II

how to Count same values one time

Hi Team,

I have a data like below:

SEALTAMSSOXRISK
1216T529Yes
1217T529High
1218T529Critical
1219T530Critical
1220T531Pending
1221T532Yes
1222T533Critical
1223T533High
1224T533Pending
1225T533Medium

Above table "SEAL" data is  Unique Values and "TAMS" data is Repeated Values.

My requirement is:

In the above table same TAMS (T529,T533) have multiple SOX values.So i want to calculate tams count based on priority.

SOX priority:

SOX

Yes

Critical

High

Medium

Pending

1)If SOX='Yes' then calculate TAMS count only these TAMS(T529,T532)

2)If SOX='Critical' then calculate TAMS count only these TAMS(T530,T533) .Here T529 ,T533 Id's SOX have Critical But Same Id We are counting in If SOX='Yes'.So no need to calculate again.

Expected Results:

SOXTAMS COUNT
Yes2
Critical2
High0
Medium0
Pending1
2 Replies
sunny_talwar

May be this

=Sum(Aggr(

If(Count(DISTINCT TOTAL <TAMS> {<SOX = {'Yes'}>} TAMS) = 1, Count(DISTINCT {<SOX = {'Yes'}>} TAMS),

If(Count(DISTINCT TOTAL <TAMS> {<SOX = {'Critical'}>} TAMS) = 1, Count(DISTINCT {<SOX = {'Critical'}>} TAMS),

If(Count(DISTINCT TOTAL <TAMS> {<SOX = {'High'}>} TAMS) = 1, Count(DISTINCT {<SOX = {'High'}>} TAMS),

If(Count(DISTINCT TOTAL <TAMS> {<SOX = {'Medium'}>} TAMS) = 1, Count(DISTINCT {<SOX = {'Medium'}>} TAMS),

If(Count(DISTINCT TOTAL <TAMS> {<SOX = {'Pending'}>} TAMS) = 1, Count(DISTINCT {<SOX = {'Pending'}>} TAMS))))))

, TAMS, SOX))

Clever_Anjos
Employee
Employee

Please use a Straight Table

Dimension: =Aggr(FirstSortedValue(SOX,Match(SOX,'Yes','Critical','High','Medium','Pending')),TAMS)

Expression : Count(Distinct TAMS)