Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Aggr with previous months

Hello !

I need to insert a set analysis showing last 3 months, but i use aggr function in it.

Look:

=Count(

DISTINCT Aggr(if(((Sum(QtdeOcorFSP) + Sum(QtdeOcorOESP)) = 0),nCdDistribuidor_RabRoteiro),nCdDistribuidor_RabRoteiro, MesAno_RABRoteiro))

So what i want is :

if the sum of QtdeOcorFSP and QtdeOcorOESP is 0, then, i count nCdDistribuidor_RabRoteiro, using aggr MesAno_RABRoteiro and nCdDistribuidor_RabRoteiro as Dimensions.

I've inserted set analysis before "distinct", but if i select the month, dont bring me last 3 months, because i'm grouping by my dimension MesAno_RABRoteiro .

But i need to see this with last 3 months of maxDate. If i select september, it will show jul, ago and sep. If select ago, show ago, jul, and jun.

I'm using a pivot table with MesAno_RABRoteiro and affiliate as dimension. Have just 1 expression, which i've explained.

Thanks !

0 Replies