Alan, it took me (more than) a few goes to get there, but finally I got my vote in.
A comment on the use case however:
Alan's RFE wrote:Rather than offer one of my own I'll refer to one that Duncan Turner submitted to Applix on 19 May 2005 (coming up to 10 years ago), for users the world over have had the same problem for the same amount of time:
I am building a subset from a repeating source file e.g. multiple rows contain the same element.
When building a dimension, no duplicates are allowed and so the build is clean. However, when building a subset, each element is inserted one-for-one, resulting in a subset with as many elements as the source has rows.
In order to get a "clean" subset, I am having to either build a temp dimension and then a subset, or loop the subset to check for an element's existence.
You can quickly solve this with:
Code: Select all
{ Distinct ( TM1SubsetToSet ( [YOUR_DIMENSION], "YOUR_SUBSET_NAME" ) )}
If you can edit the RFE, can I suggest another use case that might be included in order to bolster the case for this function: a user makes a selection through a picklist and I need to test if the element is part of a 'special' subset e.g. live projects or valid companies etc, and then take further action. A SUBIX or SubsetElementExists function would allow me to perform this in a single IF condition rather than use other less performant methods.
Maybe, by putting the emphasis on enabling user-focused activity then they might sit up and take notice a bit?
jcr55, you could do this:
Code: Select all
SubsetCreateByMdx ( 'TEMP_SUBSET', '{ Intersect ( { [YOUR_DIMENSION].[INPUT_ELEMENT] }, TM1SubsetToSet ( [YOUR_DIMENSION], "YOUR_SUBSET_NAME" ) )}', 'YOUR_DIMENSION' );
IF ( SubsetGetSize( 'YOUR_DIMENSION', 'TEMP_SUBSET' ) > 0 );
# do stuff
ENDIF;
But it would be much, much better to have the function per the RFE.