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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Dwyane
Contributor II
Contributor II

Calculated expression on a chart

Hi All,

 

Im having some trouble with a table that i wondering if i could get some help on. I have a table that i would like to look like this

 

MonthCUSTOMER_ NAMEDOBREFPriceSoldActual%
1ABC2020-11-23ABC12310030033%
1DEF2020-03-01DEF12315031248%
1GEH2020-01-01GEH12320032462%
2ABC2020-11-23ABC12325033674%
2GEH2020-01-01GEH12330034886%
2DEF2020-03-01DEF12335036097%
3ABC2020-11-23ABC123400372108%
3DEF2020-03-01DEF123450384117%
3GEH2020-01-01GEH123500396126%

 

However unless i click on a particular customer name, or customer reference the actual does no populate  

Price is sum(aggr(sum(X_Price),[Month]))

Sold is sum([Sold_Price])

Actual is sum([Sold_Price])/sum(aggr(sum(X_Price),[Month])),[CUSTOMER_ NAME],[Ref], [DOB]))

 

My dimensions are CUSTOMER_ NAME, REF and DOB. Im not what i should change so the actual value populates without selecting a particular customer

 

Thanks in advance!

1 Reply
stevejoyce
Specialist II
Specialist II

i'm not sure why aggr is needed as opposed to Total <field>.  But if you use aggr, it's only going to return 1 row for each field in your aggr.. i.e. 1 row for each Month, so that's probably your issue.  Try adding NODISTINCT like:  sum(aggr(NODISTINCT sum(X_Price),[Month]))

Carry this to Actual as well.