Tm1 rest api - Delete subset using $filter startswith()

Post Reply
kavitha2002
Posts: 94
Joined: Sat May 05, 2018 11:48 am
OLAP Product: tm1
Version: 10.3.10100.8
Excel Version: 14

Tm1 rest api - Delete subset using $filter startswith()

Post by kavitha2002 » Thu Sep 13, 2018 8:53 am

Hello Everyone,

I would like to delete a subset where the subset name startswith 'abc'.

I tried with

Code: Select all

http://host:8001/api/v1/Dimensions('Dimname')/Hierarchies('Dimname')/Subsets('fullname')
its working

But filter startswith below gives error.

Code: Select all

http://host:8001/api/v1/Dimensions('Dimname')/Hierarchies('Dimname')/Subsets($filter=startswith(Name, 'abc')) 
any idea of how to achieve this.

Thanks in advance

bgregs
Posts: 37
Joined: Wed Sep 12, 2018 11:19 am
OLAP Product: TM1 / Planning Analytics
Version: 2.0
Excel Version: 2016

Re: Tm1 rest api - Delete subset using $filter startswith()

Post by bgregs » Mon Sep 17, 2018 12:12 pm

Taken from the OData site:

Code: Select all

	https://services.odata.org/Northwind/Northwind.svc/Customers?$filter=startswith(CompanyName, 'Alfr') eq true 
I have used this in the past and had success. Have you included your conditional check at the end of your call? (i.e. "eq true")

kavitha2002
Posts: 94
Joined: Sat May 05, 2018 11:48 am
OLAP Product: tm1
Version: 10.3.10100.8
Excel Version: 14

Re: Tm1 rest api - Delete subset using $filter startswith()

Post by kavitha2002 » Mon Sep 17, 2018 1:20 pm

Hi Thanks for your response, but I tried in my end, but its not working...

I am performing a delete of subset.

Code: Select all

http://host:8001/api/v1/Dimensions('dimname')/Hierarchies('dimname')/Subsets?$filter=startswith(Name, 'abc') eq true
gives the below error

"message": "DELETE not allowed on a contained collection valued navigation property!"

bgregs
Posts: 37
Joined: Wed Sep 12, 2018 11:19 am
OLAP Product: TM1 / Planning Analytics
Version: 2.0
Excel Version: 2016

Re: Tm1 rest api - Delete subset using $filter startswith()

Post by bgregs » Mon Sep 17, 2018 2:43 pm

Ahhh, I have never implemented that with a "delete" function on a subset. Interestingly enough I was able to find this post on one of the IBM forums:
Hi,

does the TM1 REST API allow DELETE operations with $filter on collections to delete all matching element, as specified in
https://www.oasis-open.org/committees/d ... nutes.html


I want to do something like this:
https://10.77.19.60:12354/api/v1/Dimens ... th(Name,'e')
Response from IBM:
Not yet Marius, ODATA-616 is targeted at the v4.01 OData specification. We have adopted a couple of patterns, extending what's allowed in OData v4, already in our implementation but this isn't one of them, not yet.
Looks like it's not available yet.

Link to forum discussion: https://www.ibm.com/developerworks/comm ... 7f4ad3e2f6

kavitha2002
Posts: 94
Joined: Sat May 05, 2018 11:48 am
OLAP Product: tm1
Version: 10.3.10100.8
Excel Version: 14

Re: Tm1 rest api - Delete subset using $filter startswith()

Post by kavitha2002 » Wed Sep 19, 2018 6:11 am

Hello bgregs,

Thanks for your prompt response and your time:)

Post Reply