How to check for the presence of the element in the subset?

Post Reply
bogdan
Posts: 18
Joined: Wed Oct 15, 2014 9:33 am
OLAP Product: Cognos
Version: 10.2
Excel Version: 2013

How to check for the presence of the element in the subset?

Post by bogdan »

Hello, How to check for the presence of the element in the subset?
Thanks.
tm1_bloke
Posts: 25
Joined: Sun Oct 13, 2013 6:03 am
OLAP Product: TM1
Version: 10.2
Excel Version: 2010

Re: How to check for the presence of the element in the subs

Post by tm1_bloke »

Well, you didn't specify your need so:
1. Visually in subset editor :)
2. Write a while loop in TI process to loop thru subset indexes from 1..n where n=SubsetGetSize(<subset_name>) and check with IF condition and SubsetGetElementName function if the element equals to the element you are looking for and store the result of comparison in a variable for later use. There is no ready made function available for your need. Also, note that an element can exist multiple times in subset so an additional counter to indicate the number of occurences in while loop could be useful (?).

May I ask what's your use case where you need this information?
Alan Kirk
Site Admin
Posts: 6647
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: How to check for the presence of the element in the subs

Post by Alan Kirk »

tm1_bloke wrote:Well, you didn't specify your need
Quite so. I thought that the Request For Assistance Guidelines were pretty clear on this point.
RFA Guidelines wrote:2) Ensure that you specify the component of the software that you're having a problem with. If someone states that they have a problem with number formatting, people need to know whether that's in Cube Viewer, Web, EV, the API, or wherever.

3) Try to make the question as specific as possible. A general question like "How do I write a rule?" is difficult to answer without copying out the whole of the user manual. A question like "I have a payroll cube which contains the following dimensions {details} and a general ledger cube which contains the following dimensions {details}, and although I've read through the Rules Guide I'm still not sure how to write a rule to give me average sales per employee" is far more likely to get the answer your need.
tm1_bloke wrote:1. Visually in subset editor :)
Heh, heh... cruel but fair, that one.
tm1_bloke wrote:2. Write a while loop in TI process to loop thru subset indexes from 1..n where n=SubsetGetSize(<subset_name>) and check with IF condition and SubsetGetElementName function if the element equals to the element you are looking for and store the result of comparison in a variable for later use.
Yup, and that's exactly why those guidelines are there. If the existence was being checked in Excel / VBA rather than TI it would be necessary to use SubSiz and SubNm respectively instead. Failing to provide full details of a question just wastes everyone's time because all they can do is guess at what the context is.
tm1_bloke wrote:There is no ready made function available for your need.
Unfortunately. It has been raised before of course. It's currently sitting equal second on the DeveloperWorks request for enhancement list with 7 votes, one behind the AsciiAppend function.I do encourage anyone with a DeveloperWorks account to get in and support the request (63581) by votes and comments if you want to see IBM pay some attention to it.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: How to check for the presence of the element in the subs

Post by BariAbdul »

Hi bogdan,I don't know how much it would help but worth to go through :) :
http://www.tm1forum.com/viewtopic.php?f ... 1840#p1840
"You Never Fail Until You Stop Trying......"
Post Reply