Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to get Indexed values in QV but am not able to do so. Would be a great help if someone can help. What I want is explained below as an example.
Day | Price | Return | Index |
1 | 1000 | 100 | |
2 | 991 | -0.9% | 99.1 |
3 | 1010 | 1.9% | 101 |
4 | 1021 | 1.1% | 102.1 |
5 | 1030 | 0.9% | 103 |
Day & Prices are what I have and rest needs to be done by QV.
Hi
Use something simmilar:
IF(isnull(Peek('Index')), 100, PEEK('Index')) * (1 + [Expression for the Return Value]) AS Index
Replace [Expression for the Return Value] with your expression.
Cheers
Darius
Hi
Could you provide business logic, how to calculate these indexes?
Cheers
Darius
The indexed value would show how much $100 if invested in the commodity grows to after every day.
Formulas for calculations are as under:
Return: today's Price / Yesterday's Price -1
1st Index value = 100 * (1+return)
Subsequent index values: Previous Index value * ( 1+ return)
I am also attaching an excel to showcase the calculations
hi,
i think you can use
load ((price-previous(price))/10) as return in your script
thanks
Hi,
I have already used Peek for calculating returns, Need help with the index part
hi,
the formula for index which you have mentioned previousindex*(1+return)
gives 10 as the second index value
i am not clear as to what exactly u want
to me it seems that you are just dividing the price by 10 to get the index value
pls be a bit more clear
thanks
Hi
Use something simmilar:
IF(isnull(Peek('Index')), 100, PEEK('Index')) * (1 + [Expression for the Return Value]) AS Index
Replace [Expression for the Return Value] with your expression.
Cheers
Darius
Thanks worked