
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do while loop with calculation
Hey guys,
I am stuck on an assignment
The issue is as following:
I need to calculate eacht 10th percentile for a dataset, so i wanted to solve this with a do while loop.
My data looks like this:
Table:
load* inline
['Description','Amount'
'XXX',1231
'YYYY',13156
...
]
(delimiter is ',');
Let i=0;
do while (i>=0)
fractile(Amount,i) as percentile_i;
let i= i+.1;
Loop
I keep getting the error "Unknown statement: fractile(Amount,i)"
Thx
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Kain_F
You can't use the Fractile - script function as you are trying to do in your script, the Fractile applies to a dataset, you can not use it on a single record, or if you do (as I write my reply, I realized it could be possible), you will get misleading results.
Hope this helps,
A journey of a thousand miles begins with a single step.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Kain_F
You can't use the Fractile - script function as you are trying to do in your script, the Fractile applies to a dataset, you can not use it on a single record, or if you do (as I write my reply, I realized it could be possible), you will get misleading results.
Hope this helps,
A journey of a thousand miles begins with a single step.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ArnadoSandoval Thanks,
I solved it by loading a series like this
Percentiles:
load*Inline[
'Percentile'
0.05
0.10
0.15
...
0.95
1.00]
Then in the chart i used fractile(amount,percentile) with a table that has percentiles as dimensions and fractiles as measures

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Kain_F
I am glad you resolved your issue !!!!
A journey of a thousand miles begins with a single step.
