Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am having problem to calculate the minimum value of the field .For a particular date and Ref id i want to take the minimum to display it to all other rows.
My table is
| Date | Ref id | id | Rank |
|---|---|---|---|
| 9/302013 | 1 | 100 | 2 |
| 9/302013 | 1 | 212 | 3 |
9/302013 | 1 | 225 | 3 |
| 10/2/2013 | 1 | 400 | 4 |
my resultant table:
| Date | Ref id | id | Rank |
|---|---|---|---|
| 9/30/2013 | 1 | 100 | 2 |
| 9/30/2013 | 1 | 212 | 2 |
| 9/30/2013 | 1 | 225 | 2 |
| 10/2/2013 | 1 | 400 | 4 |
here , i need to calculate the minimum rank based on date and Ref id but i am not able to calculate .
can any one give me the solution to this.
Thank in Advance
Regards
Kumar
Min(Total<Date, [Ref id]> Rank) should do it.
Hi,
look at firstsortedvalue()
Is it based on Date and Ref id or id???
because in above example Date and Ref Id are same for 1 st 3 id
Regards
Hi Aaron Morgan ,
Thanks for reply , But i want to use this in the script side
Can you give any example of this
Regards
Kumar
HI Max,
It is based on the Date
Regards
Just create a resident load like:
Join([Your Table])
Load
Date,
Min(Rank) as MinRank
Resident [Your table]
Group by Date;
But , when i am using this i may get the minimum value of the rank and it is assign to all the other.
for example if it have rank values 1,2,3,4,5 and it will give the minimum of these and it is displaying .
I didnt want to show least minimum to all other , i want to take the minimum rank in a particular day(i.e 2,4,5 then i want to show 2 to all others)
Regards
kumar
Using the above method I got exactly what you wanted from your output table - it attaches it to the date only (you can include ref id as a group by, but in response to another question you said you only want it by date) therefore will show the minimum value for the date - there is no id attached unless you put that in the resident load.
See attached - I haven't bothered adding an aggregation to MinRank because you've already done it in the script. If I've misunderstood your requirement please be clearer or show a better example result table
Join([Your Table])
Load
Date,
[Ref id],
Min(Rank) as MinRank
Resident [Your table]
Group by Date, [Ref id];
Thanks Aaron ,
It was helped me a lot .
Regards
Kumar