Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I wanted to calculate Rank function for 3 files with Sales Values how to arrive that in attached QVF any Idea?
Thanks in adv
Message was edited by: vikas mahajan
Hi,
you already calculated the Rank for that Table.
if your files have the same structure, load them all (using * for example) after that Create the Rank like you did on your app.
Thanks for reply can you please modify the script ? I am getting incorrect ranks for the same
Vikas
What is the expected output?
Hi Sunny,
Modified QVF , Actually I have Comp,Prod,State fields as a dimensions and Sale I wanted to find each company Rank of product sold in state.
Like Comp Prod State Rank
A MS S1 2
A HS S2 1
B HS S1 3
B MS S1 1
etc..
Vikas
What did you modify? I see the same information in the Rank.qvf...
I have modify some inline columns please check this image
May be this
INPUT:
LOAD * INLINE [
COMP,Sale,State,Prd
A, 14,S1,MS
B, 22,S2,HS
C, 9,S3,MS
A, 9,S4,HS
B, 5,S4,HS
C, 3,S3,MS
A, 5,S1,MS
B, 9,S2,MS
];
RANK:
LOAD *,
If(State = Peek(State), RangeSum(Peek('Rank'), 1), 1) as Rank
Resident INPUT
order by State, Sale desc;
DROP Table INPUT;
Do you have to do it in script? You can use rank function in the chart like this:
Hi Vikas,
If you require to perform rank option in back end try this,
LOAD *,
Autonumber(Sale,Key) as Rank
Resident test
Order by Sale desc;
drop table test;
where Key is a composite key of COMP& "Product Group"&STATECODE .
Hope this helps.
Nivethitha.