Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Daora342423
Contributor
Contributor

KPI based on Aggr() function

Hi all i have a problem: i have a KPI that run in this way

 

sum( total <column A>

          aggr(

                    if( etc etc etc, 1), column B, column C)

 

but the aggregation function, although I create a field that is the concatenation of my 2 fields "campoB" and "Campo C" through autonumberhash, decides to cut me off the results from the count !! I don't know what to do anymore ... if I remove the aggregation function the KPI does not work, if I put it wrong the calculation ... I can't add the 1 of my "if" without the aggr?

               

6 Replies
sunny_talwar

Would you be able to share a sample to show the issue you are running into?

rubenmarin

Maybe you need to add columnA in aggr parameters?

As said by Sunny a sample will be nice to check.

Daora342423
Contributor
Contributor
Author

sum( total <[RST Codice]>
aggr(
if(

sum( total <A3GCounter, [Causale (categoria)]>
{<
Transaction_Day={">=$(=vA3GNumeroGiorni)"},[Causale (descrizione)]-={'INIZIATIVA 2%'},DESC_TP_SOTT_PAG_FEND-={'SUCCESSIONE','RITENUTA NON DOVUTA','RIM.NO FIRMA C.F.'},DESC_TP_PAG_FEND-={'RID','REINV.DIST.DIV.REALI'},FLG_IS_CF={0},AnnoMeseCifre=,DateStamp=,Transaction_OrderDate_Num={">=$(vA3G_DataRangeMin)<=$(vA3G_DataRangeMax)"}, [Causale (categoria)] = {'ACQ','VERS','SWIN','SWOUT','PREL','VEN'}
>}
fabs([Controvalore lordo transazione])) > vA3GSoglia

and

count( total<[RST Codice]>
{<
Transaction_Day={">=$(=vA3GNumeroGiorni)"},[Causale (descrizione)]-={'INIZIATIVA 2%'},DESC_TP_SOTT_PAG_FEND-={'SUCCESSIONE','RITENUTA NON DOVUTA','RIM.NO FIRMA C.F.'},DESC_TP_PAG_FEND-={'RID','REINV.DIST.DIV.REALI'},FLG_IS_CF={0},AnnoMeseCifre=,DateStamp=,Transaction_OrderDate_Num={">=$(vA3G_DataRangeMin)<=$(vA3G_DataRangeMax)"}, [Causale (categoria)] = {'ACQ','VERS','SWIN','SWOUT','PREL','VEN'}
>}
distinct (A3GCounter&[Causale (categoria)])) > vA3GNumeroTransazioni,

1
), A3GCounter, [Causale (categoria)]))



this is my problem
sunny_talwar

I see an expression... but I still don't see the problem 🙂

Daora342423
Contributor
Contributor
Author

The count of the expression is wrong
sunny_talwar

okay good... so you know what is not right... how do you want to help you? Just by looking at the expression, how can I tell you what to fix?