Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
md_anasabbasi
New Contributor III

Not able to aggregate the data

Hi All,

    I came across the following set of data and I am confused how to actually calculate(write the expression)-

AccountAddressStructuresamount
abc143 east street21254

abc

143 east street21257
abc143 east street245689
abc124 wing17895
abc124 wing1475
abc124 wing13587
abc124 wing1454
abc12 ertsd54585
abc12 ertsd575412
xyz134 hinjew14546
xyz134 hinjew158794
xyz134 hinjew1451642
xyz85,E blue4121
xyz85,E blue4124578

   I have a text object which should show total structures-

If account 'abc' is selected so total structures=2+1+5=8

How should i write the expression for this, need help.


Thanks

5 Replies
Partner
Partner

Re: Not able to aggregate the data

maybe, sum(distinct Structures) ?

Capture.PNG

Capture.PNG

trdandamudi
Honored Contributor II

Re: Not able to aggregate the data

One way is as below:

Partner
Partner

Re: Not able to aggregate the data

Hello Anas,

try

aggr(sum(Structures),Structures)

or

sum(aggr(Structures,Structures))

I'am not exactly shure which of both works

Partner
Partner

Re: Not able to aggregate the data

Hi,

The above example will work on selection.

But if you want it say on a chart

Use

=SUM(AGGR(ONLY(Structures),Address))

Mark

Partner
Partner

Re: Not able to aggregate the data

sum(distinct Structures) would do it; why complicate things?

Capture.PNG