Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
dhruvkumar_josh
Contributor
Contributor

While Applying Aggregation Expression level in chart its changing the output Result

Hi All Qlik Experts,

I am facing one issue in Aggr function.

Scenario:

I need the count of customer who has been missed to be server particular product Rolling 4 Weeks.

so i applied aggr functiion, at summary level the count of customer is not coming proper but if i select any one product its coming proper.

Expression is :

=count({<[Distribution R12W]={9,10,11,12},Flag1={'Distribution'}, [All Targeted SKU Flag]={1}>} aggr(if(max({<[Distribution R12W]={9,10,11,12},[All Targeted SKU Flag]={1}>}[Served SKU Flag])=0, Customer),Customer))

For more info please refer the attached screenshot.

Thanks,

Dhruv.

Count issue.jpg

16 Replies
andrey_krylov
Specialist
Specialist

Hi, Dhruv. Try this

=Sum({<[Distribution R12W]={9,10,11,12},Flag1={'Distribution'}, [All Targeted SKU Flag]={1}>} if(aggr(max({<[Distribution R12W]={9,10,11,12}, TOTAL<Customer> [All Targeted SKU Flag]={1}>}[Served SKU Flag])=0, Customer), 1))

dhruvkumar_josh
Contributor
Contributor
Author

Thanks Andrey for your quick reply.

But when i am using your suggested expression is not working becuase of that Total <Customer>. can you please recheck and help it.

=Sum({<[Distribution R12W]={9,10,11,12},Flag1={'Distribution'}, [All Targeted SKU Flag]={1}>} if(aggr(max({<[Distribution R12W]={9,10,11,12}, TOTAL<Customer> [All Targeted SKU Flag]={1}>}[Served SKU Flag])=0, Customer), 1))

Thanks,

Dhruv

Anil_Babu_Samineni

I think this will suffice

Count(aggr(if(max({<[Distribution R12W]={9,10,11,12},[All Targeted SKU Flag]={1}>}[Served SKU Flag])=0, Customer),Customer))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
dhruvkumar_josh
Contributor
Contributor
Author

Thanks Anil,

While applying your given expression , it's only giving me 1 Product code and doesn't shows other code .

can you please check it because the logic wise my expression is correct but not working properly.

Thanks.

Anil_Babu_Samineni

Can you attach sample

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
dhruvkumar_josh
Contributor
Contributor
Author

Do you want image or Design part?

if the design part, then it is too heavy so not possible to attach. i

balabhaskarqlik

May be this expression:

=if(max({<[Distribution R12W]={9,10,11,12},[All Targeted SKU Flag]={1}>}[Served SKU Flag])=0,

Aggr(

count({<[Distribution R12W]={9,10,11,12},Flag1={'Distribution'}, [All Targeted SKU Flag]={1}>}Customer),

Customer)

)

balabhaskarqlik

May be try this:

=Count(if(max({<[Distribution R12W]={9,10,11,12},[All Targeted SKU Flag]={1}>}[Served SKU Flag])=0,

Aggr(

count({<[Distribution R12W]={9,10,11,12},Flag1={'Distribution'}, [All Targeted SKU Flag]={1}>}Customer),

Customer)

))

sunny_talwar

What exactly is your dimension in the chart above? Is it Customer of something else?