Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum of Distinct

Hi

I have a variable named as vTAT

I have to find the sum of vTAT based on DISTINCT MAR

MAR                vTAT

123454                 1:23

123454                  1:23

123456                 4:15

1234566                 5:17

Regards

Senthil

12 Replies
swuehl
MVP
MVP

Create a chart with dimension MAR and as expression

=sum(vTAT)

Or post your expected result..

PrashantSangle

Hi

or you can try

=sum(DISTINCT vTAT)

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi

I want to show it in a BAR Chart with Dimension as Date , Expression as Avg of vTAT of DISTINCT MAR

Regards

Senthil

buzzy996
Master II
Master II

se tis,

tat:

Load * INLINE [

MAR,vTAT

123454,1:23

123454,1:23

123456,4:15

1234566,5:17

];

tat2:

nOCONCATENATE Load MAR,

SUM(vTAT) AS vTAT

resident tat

group by MAR;

Drop table tat;

Not applicable
Author

Hi

I want to show it in a BAR Chart with Dimension as Date , Expression as Avg of vTAT of DISTINCT MAR

rubenmarin

Hi, vTat is a variable? and what's the expression of the variable? Maybe this works if vTAT has the same value for the same MAR:

Avg(Aggr(vTAT, MAR))

Not applicable
Author

Hi

Yes vTAT is a Variable

Not applicable
Author

Hi

Below is the sample data

   

   

DateMAR         vTAT
2015-04-24150424SCBLAU2SAXXX44958660321:13:41
2015-04-24150424SCBLAU2SBXXX012300400263:41:27
2015-04-24150424SCBLAU2SAXXX449586603365:52:23
2015-04-24150424SCBLAU2SBXXX012300400263:41:27
2015-04-24150424SCBLAU2SBXXX0123004002

63:41:27

Need to find the average of vTAT for DISTINCT MAR using Date as Dimension

Average should be around 43:35:50

Regards

rubenmarin

Hi, using "Avg(Aggr(vTAT, MAR))" returns 43:35:50, PFA.