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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
QS_User_2019
Contributor II
Contributor II

Aggr Function With Calculation

Hello,

I would like to create a table and Pie Chat and identify the "Customer" type based on below logic but not sure why it can not show properly. 

=Aggr(if([Special Customer]=1 and um(Gross Profit)>=0, 'Special Customer Profitable',

if([Special Customer]=1 and sum(Gross Profit)<0, 'Special Customer Loss Making',

if([Special Customer]=0 and sum(Gross Profit)>=0, 'Profitable',

if([Special Customer]=0 and sum(Gross Profit)<0, 'Non-Special Customer Loss Making',null())))), [Customer])

I apply above formula on the table, not sure why there are many null in the tbla.

Table

YearMonthCustomerRevCosGross ProfitQuantitySpecial CustomerMy Aggr Function
2019OctAAA5004001001000 
2019OctBBB300600-3002001 
2019NovAAA6003003005000 

 

For the Pie Chat, I apply the same formula as the dimension. For the measure, I use sum(Quantity). But it can not show correctly as well.

Anyone can help me on this issue.

Labels (2)
1 Reply
Anil_Babu_Samineni
MVP
MVP

By seeing the data it is not full-filling the condition of 4 expressions. Please validate individual and then try?

 

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