Using Datastream functions in DSWS

AlexK
AlexK Newcomer
edited May 13 in Datastream

Hi, is it possible to use Datastream aggregation functions in DSWS? E.g. sth like F:VIE(SUM#(X(UDD),2023-01-09,2025-05-02))? Thx
PS: Sorry if the question was already asked, the gateway was down so I couldnt perform a search…

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @AlexK

    Thank you for reaching out to us.

    Is it this one?

    df = ds.get_data(tickers="F:VIE|E", 
                     fields = [
                         "SUM#(X(UDD),2023-01-09,2025-05-02)"],
                     kind=1)
    df
    

    I am using the Datastream Web Service.

  • AlexK
    AlexK Newcomer

    Hi Jirapongse, thank you very much. I have just realised that I wasn't precise with my question. I realised I am using DSS REST, making a request using the HTTPS Post method and XML… The response I am getting from the server is $$"ER","E21B","INVALID CODE F:VIE(SUM#(UDD,2023-01-13,2025-05-09)) ",

  • Jirapongse
    Jirapongse ✭✭✭✭✭
  • AlexK
    AlexK Newcomer

    This is the message I am using: (I replaced the TokenValue with XXX)
    <DSGetDataRequest xmlns="http://dsws.datastream.com/client/V1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><DataRequest><DataTypes/><Date><End></End><Frequency>Y</Frequency><Kind>Snapshot</Kind><Start></Start></Date><Instrument><Properties><DSStringObjectKVPair xmlns="http://dsws.datastream.com/client/V1/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Key>IsExpression</Key><Value i:nil="true"/></DSStringObjectKVPair></Properties><Value>F:VIE(SUM#(UDD,2023-01-13,2025-05-09))</Value></Instrument><Tag i:nil="true"/></DataRequest><TokenValue>XXX</TokenValue></DSGetDataRequest>

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @AlexK

    It could be the DSWS SOAP API.

    You can check the request message from this website (https://product.datastream.com/DswsClient/Docs/TestSoapV1.aspx).

    image.png

    The request message is:

    <GetData xmlns="http://dsws.datastream.com/client/V1/">
    	<request	xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    		<DataRequest>
    			<DataTypes>
    				<DSDataType>
    					<Properties i:nil="true"/>
    					<Value>(SUM#(UDD,2023-01-13,2025-05-09))</Value>
    				</DSDataType>
    			</DataTypes>
    			<Date>
    				<End/>
    				<Frequency/>
    				<Kind>TimeSeries</Kind>
    				<Start/>
    			</Date>
    			<Instrument>
    				<Properties>
    					<DSStringObjectKVPair>
    						<Key>IsExpression</Key>
    						<Value i:type="d9p1:boolean" xmlns:d9p1="http://www.w3.org/2001/XMLSchema">true
    						</Value>
    					</DSStringObjectKVPair>
    				</Properties>
    				<Value>F:VIE</Value>
    			</Instrument>
    			<Tag i:nil="true"/>
    		</DataRequest>
    		<Properties i:nil="true"/>
    		<TokenValue><token></TokenValue>
    	</request>
    </GetData>
    
  • AlexK
    AlexK Newcomer

    Hi, unfortunately, this does not produce the intended result. Instead of delivering the sum of unadjusted dividends for F:VIE over the time period from 13-jan-2023 to 9-May-2025 (a snapshot), it returns the price of the security. Any idea why the calculation is not performing?

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    Do you have a working formula used in Excel?

    Otherwise, please contact the Datastream support team directly via MyAccount.