Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
danimarc12
Partner - Creator
Partner - Creator

Count, aggr, KPI issue

Hello everyone!

I have an issue with a KPI in my project work.

In my straight table I have many idMarca. I want to calculate the New Sales in the cur year so I'm using the expressions you can see in the bottom of the table (Data in my date field of my Master Calendar and datadocumento is the date field of the sale).

Pic1.PNG

So, regarding the table, I have 6 new sales.

In my KPI, of course it's not correct, I wrote the expression in the bottom of the table and I'm obtaining a wrong value.

Pic2.PNG

Could anyone explain my error and suggest me the correct expression?

Thanks to who's answering!

DM

Labels (1)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Count( Distinct
Aggr(
IF ( date(min({<Data=>} datadocumento)) >= date(YearStart(max(Data))), idMarca)

, idMarca)
)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

5 Replies
vinieme12
Champion III
Champion III

=Count(DISTINCT Aggr( IF ( min(.......)>=date(YEarstart(.....)) , IdMarca), IdMarca) )

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
danimarc12
Partner - Creator
Partner - Creator
Author

Hi @vinieme12 ,

thanks for ur answer but it still wrog:

Pic2.PNG

vinieme12
Champion III
Champion III

your expression is incorrect, please paste the expression here so i can modify it for you

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
danimarc12
Partner - Creator
Partner - Creator
Author

@vinieme12  this is the expression of the KPI:

Count(DISTINCT Aggr( IF (min({<Data=>}date(datadocumento)) >= date(YearStart(max(Data)))) idMarca, idMarca))

vinieme12
Champion III
Champion III

Count( Distinct
Aggr(
IF ( date(min({<Data=>} datadocumento)) >= date(YearStart(max(Data))), idMarca)

, idMarca)
)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.