Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I have some tickers which have ratings and rating dates . Ex:
Ticker Rating Author Rating Date
APPLE B Stefan 01/01/2010 00:00:00
APPLE Buy Richard 01/01/2010 00:00:00
APPLE NA Eugene 05/02/2012 00:00:00
I am getting the max of rating date from this .If max Rating Date matches with Rating NA for each Ticker .It should be excluded.
It should not go back and pick previous rating which is Buy .
Thanks,
Venkata
Please find the example attached.
Like attached. Please check the back-end and see if data is excluded per your logic.
Hope it helps
Thanks
AJ
source:
load *, rowno() as id;
load * inline [
Ticker , Rating , Author , Rating Date
APPLE , B , Stefan , 01/01/2010 00:00:00
APPLE , Buy , Richard , 01/01/2010 00:00:00
APPLE , NA , Eugene , 05/02/2012 00:00:00
PA , B , Stefan , 01/01/2010 00:00:00
PA , Buy , Richard , 01/01/2010 00:00:00
PA , Buy , Eugene , 05/02/2012 00:00:00
PB , B , Stefan , 01/01/2010 00:00:00
PB , NA , Richard , 01/01/2010 00:00:00
PB , NA , Eugene , 05/02/2012 00:00:00
PC , B , Stefan , 01/01/2010 00:00:00
PC , Buy , Richard , 01/01/2010 00:00:00
PC , NA , Eugene , 05/02/2012 00:00:00
PC , NA , Eugene , 05/02/2012 00:00:00
];
NoConcatenate
load *
Resident source
where Rating <> 'NA'
and Peek(Ticker)<>Ticker
order by Ticker, [Rating Date] desc, id desc;
;
DROP Table source;
Hi Sudeep ,
thanks for your reply. I have one more question .
when the user selects some date range the rating should appear. How can i achieve it.
If suppose user selects dates from 2010 - 2012
Ticker Rating Author Rating Date
APPLE B Stefan 01/01/2010 00:00:00
APPLE N Stefan 05/01/2012 00:00:00
APPLE NA Richard 05/01/2014 00:00:00
Here the date range is 2010 - 2012 So, the Ticker should appear since it has rating N which is not happening in the above attached qvw .
Any solution or ideas