Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
bhaveshp90
Creator III
Creator III

Error in Expression - Duplicate Values

Hello, 

I have a table below as shown below. I have my expression for OEC - Current as 

 =If(Num_Month = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 0, Sum(Updated_OEC_Budget)) 

Sum(Updated_OEC_Budget) = 179922+522900 = 702822; but the expression is wrong (Duplicate Values as you see below).

1.PNG

 

Can anyone help me how to fix these duplicate values? Attached is the qvd and qvw file

 

thanks

Bhavesh

 

Labels (3)
5 Replies
jduenyas
Specialist
Specialist

try this:

=If(Num_Month = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 0, Sum(AGGR(Updated_OEC_Budget,  Cost-Code)))

bhaveshp90
Creator III
Creator III
Author

@jduenyas that expression works for Total, but when I change the Engineering_Area the value becomes 0 

bhaveshp90
Creator III
Creator III
Author

@sunny_talwar@jonathandienst@swuehl, Can you please look into this problem? 

 

 

jonathandienst
Partner - Champion III
Partner - Champion III

It seems like one of the joins or the logic in the load script is causing duplicate records. Your data model may need to be changed to better suit your analysis.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Donicc
Contributor II
Contributor II

As a test, try removing the NCC_Code column and see if the duplicates are removed.  Looks like you are getting a row for each distinct value of NCC_Code.