Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have a table with the following fields:
ID Quarter CurrentValue PCT LL
1 3/2013 483 4.31% 483
2 4/2013 483 4.31% 504
3 1/2014 483 4.31% 525
I used the following formula to create a new field named LL as follow
if( ID<>Previous(ID),CurrentValue,peek([LL])*PCT)+ Peek([LL])) ) as LL ( The field is colored red above)
The requirement now is to have the PCT entered by the user into an input box and create a bar chart to show Sum(LL) by Quarter
The above script worked perfect if PCT is a static value on a column on the table. Not sure how can we do the same calculation inside a bar chart while PCT is entered by the user
Let me know your thoughts.. and thxs for help!
Best,
Alec
Hi,
Follow these steps:
1. Create one variable (suppose "vPCT") then edit your script like this:
if( ID<>Previous(ID),CurrentValue,peek([LL]) * vPCT)+ Peek([LL])) ) as LL
2. Add input box object and set this variable.
I hope this will help you.
Regards,
Ashutosh
Hi,
Thxs for your help but this doesn't work..
The script is reading vPCT as a field and throwing an error that field not found..
Best,
Alec
Try using dollar sign ('$') expansion, like:
$(vPCT)
Hi,
Sorry for that . my mistake use this
if( ID<>Previous(ID),CurrentValue,peek([LL]) * $(vPCT))+ Peek([LL])) ) as LL
Please let me know after try this.
Regards,
Ashutosh
Hi,
if( ID<>Previous(ID),CurrentValue,peek([LL]) * $(vPCT))+ Peek([LL])) ) as LL
doesn't work.. it picks up the current value of the variable.
I am wondering if we can do all the calculations made in the script for this field in the expression of the chart.
hi,
Check this attached file. and let me know.
Regards,
Ashutosh Sharma
You can try "Input field" in script.
1. Declare PCT as inputfield.
2. this will give the user the ability to change PCT values in staraight table.
3. Create a linked object as chart.
Then changing the PCT values in straight table would change the trend in chart as well.
Thanks,
Anand.
It didn't work..
On your file you have changed the last value of the current Value and on mine it is always the same.
Also, I see that ID "3" got duplicated with the new calculation while we should have only one line for each ID.
Thxs,
Alec
Hi,
Would you please give me more details on 3.
Thxs,
Alec