Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I hope someone can help me with this:
I'm trying to get an average of exchange rates for a particular calendar selection. This is calculating fine, however, when i group the transactional data by account category, the AVG(ExRate) does not give the average for months where there are no transactions. Is there a way for the calculation to ignore the account category grouping?
Let me know if I need to send a sample QVW.
thanks
James
Try something like:
=GetFieldSelections(MONTH, ',',12)
where 12 is the max possible values. If you have something like YEAR&MONTH I guess you can use another valule like 1000.
David
HI,
Its better that you create an inline table with Month and the numbers of days in month and then use this in calculation to compute the avg.
Regards,
Kaushik Solanki
Hi James,
You can use something like sum(Values)/count(DISTINCT Field), where Field contains the months.
Is there no way to calculate an avg for null data. If you have the values in the same table with the month information you can transform the the null values in the script with if(isnull(ExRate),0,ExRate) as ExRate in order to calculate the avg in chart.
Regards,
David
Thanks Kaushik
Maybe you can help me 'plug it in' - here is what I have (see screen shot)
thanks a mil
James
Thanks for the response David.
I dont think the 'count() option is a possibility, because the AVG calculation would still only include the months that the account categories exist in the transactions. (see the image i posted to the previous response)
Hi,
Just one thing tell me on what fields you have linked them together.
Regards,
Kaushik Solanki
sorry - meant to say, I have joined the tables on MONTH and YEAR.
Hi,
You can do two things.
1. Enter the records for the March month in the First Table with 0 amount.
2. You join them and make one table.
In second option you will have to avg the exchange rate first and then link them, other wise data will be replicated many a times.
Regards,
Kaushik Solanki
Thanks Kaushik
I want to avoid having to create a zero (0) transaction per category. However, if I do work on the second option you gave me, I'm worried that there will be issues because option #1 is not in place... (i.e. there will still be issues with the transactions not existant for that month - i.e. no average).
Would it be possible to separate the exchange rate table altogether (because the LINK is not even required). All i need is the average for the YEAR and MONTHS selected.. which i could possibly use getSelectedValues(YEAR) for.. correct?
James
Hi,
So do you mean you need avg exchange rate same for income and expense.
Exchange rate will remain same for both?
Regards,
Kaushik Solanki