Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

aggr function.

I'm kind of new to Qlikview. Could someone tell me what i did wrong for my program ? The final value is not correct. I use aggr() function group by a unique field. It seems to me there are some duplicate values , which does not make sense.


Sum(

{$< [Cost Transaction Date] = {"<=$(=date(max(Date)))>=$(=date(min(Date)))"} >}

Aggr(

aggr(DISTINCT

sum({$<[Cost Transaction Date] = {"<=$(=date(max(Date)))>=$(=date(min(Date)))"},

[Operation Code] = {'80','40'},

LinkId = {'OPSJ'}

>}[Cost Transaction Scrap Quantity Actual]),[Cost Job Code])

*

( aggr(distinct

sum({$< [Cost Transaction Date] = {"<=$(=date(max(Date)))>=$(=date(min(Date)))"},

[Cost Category Num] = {'3'},

[Cost Type Code] = {'1'},

LinkId = {'OPSJ'}

>}[Cost Transaction Value Actual]),[Cost Job Code])

/

aggr(DISTINCT

sum({$< [Cost Transaction Date] = {"<=$(=date(max(Date)))>=$(=date(min(Date)))"},

[Cost Category Num] = {'3'},

[Cost Type Code] = {'1'},

LinkId = {'OPSJ'}

>} [Cost Transaction Quantity Actual]), [Cost Job Code])

)

+

aggr(DISTINCT

sum(

{$< [Cost Transaction Date] = {"<=$(=date(max(Date)))>=$(=date(min(Date)))"},

[Operation Code] = {'80','40'},

LinkId = {'OPSJ'}

>}[Cost Transaction Value Actual]),[Cost Job Code])

  ,[Cost Job Code])

 

)

2 Replies
Anonymous
Not applicable
Author

Try separating the function to identify which aggr is not working properly

sunny_talwar

Very difficult to know just by looking at the expression... would you be able to share a sample where you are trying this out and it isn't giving you want you want.