Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
When trying to calculate Average Income for the YTD period, I use this and it works, but
sum({$<Year={ $(=max(Year)) }>} Commission_Amount)+Sum ({$<Year={ $(=max(Year)) }>} PIP_Profit_or_Loss)) / sum({$<Year={ $(=max(Year)) }>} Volume)
but when I try to do the same calculation for the max month , it does not work. This is how I am doing it
=sum({<MonthNumber= {$(=max(MonthNumber))},Month= ,[Month-Year]=>}Commission_Amount)+ sum({<MonthNumber= {$(=max(MonthNumber))},Month= ,
[Month-Year]=>}PIP_Profit_or_Loss )/sum({<MonthNumber= {$(=max(MonthNumber))},Month= ,[Month-Year]=>}Volume)
Please help me.
Yolanda
Please post a qlikview document that demonstrates the problem.
Please find attached
Can you tell me what's not working? I'm afraid I don't understand what result you want to see where.
I want the month calculation to work like the YTD Calc so I can calculate income for the YTD period and for the current month period.
As far as I can see that's exactly what the expression do. I don't see any wrong results.
Yeah, Its works when I split it up (Income and Volume) but just does not give the right answer when I put it together (Income/Volume).
Make sure to put the parentheses in the right places. a+b/c is not the same as (a+b)/c.
That is also not working, gives me 0.
Do you think anything else needs to be done?
I have no idea because I don't see any problem. It works fine for me. See attached qvw.