Checking for coincidence

Post Reply
Wirt
Posts: 37
Joined: Fri Feb 21, 2014 9:55 am
OLAP Product: Cognos TM1
Version: 10.1
Excel Version: 10

Checking for coincidence

Post by Wirt »

Hello!
I have a question about the verification data on repetition
I have a cube, it has a column "Number", into it writes the number of products (string element, since the numbers happen different, for example: 10-25.15a). And have a lot of lines.
I need to check in the column "Number" that was not repeated numbers
for example, someone in line 10 wrote number "10-5a", and someone else in the line 100 wrote the same number. Then the message should appear in the next column "verification" that there are numbers that are repeated.
can have any any ideas?
I would be grateful for your help
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: Checking for coincidence

Post by BariAbdul »

Just a thought,Start with counter=0 then check with DIMIX(Dimname,Ele) =1 then counter=1
and manipulate code accordingly.Apologies if I am completely wrong,gurus might help.Thanks
"You Never Fail Until You Stop Trying......"
Wirt
Posts: 37
Joined: Fri Feb 21, 2014 9:55 am
OLAP Product: Cognos TM1
Version: 10.1
Excel Version: 10

Re: Checking for coincidence

Post by Wirt »

excuse me, but I can not understand what you mean,
DIMIX function applied to elements measuring, and it is necessary to check the data that we write by hand, that there is no repetition.
I wrote the formula:
[ ] = S: IF ( DB(....,'Number')@=' ', 'Ok', IF ( DB ( ..... 'Number')@= DB(....., DB(.....,'Number') ), 'repetition', ' Ok') );
But this formula is wrong to consider, always writes that data do not coincide, while writing identical data
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Checking for coincidence

Post by Wim Gielis »

Hello

I would suggest to not do this through rules.
Use a TI process that evaluates the cells, and for example create a temporary dimension in which you insert the text entries.
Check if the entry already exists in de dimension (DIMIX function). If yes, you encounter a duplicate. If not, add to the dimension and continue.
When done, in the Epilog tab, remove that temporary dimension again.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Duncan P
MVP
Posts: 600
Joined: Wed Aug 17, 2011 1:19 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2
Excel Version: 2003 2007
Location: York, UK

Re: Checking for coincidence

Post by Duncan P »

If
  1. you are only looking for uniqueness in the column - i.e. not across the 3rd, 4th or whatever dimensions
  2. there is a reasonably small number of records
you can create a hidden column that concatenates all of the number strings, separated by e.g. tab, with each value in this column being the concatenation of the next record's concatenation and the number string for that record. The value for the first record will be the value for the complete concatenation of all the numbers. Then your rule can use SCAN to search for your number surrounded by the delimiter in that first concatenation string.

What constitutes "reasonably small" is something you will have to work out for yourself.
Wirt
Posts: 37
Joined: Fri Feb 21, 2014 9:55 am
OLAP Product: Cognos TM1
Version: 10.1
Excel Version: 10

Re: Checking for coincidence

Post by Wirt »

Maybe I have something wrong did, but in a dimension are not created the same elements
Wirt
Posts: 37
Joined: Fri Feb 21, 2014 9:55 am
OLAP Product: Cognos TM1
Version: 10.1
Excel Version: 10

Re: Checking for coincidence

Post by Wirt »

I had in mind when I make a measurement with a TI
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Checking for coincidence

Post by Wim Gielis »

Wirt wrote:Maybe I have something wrong did, but in a dimension are not created the same elements
IF you wanted to say, "in a dimension you can only insert an element once"

then you are correct. If not, I don't understand your 2 posts above. Please be more clear and also please write more than 1 sentence per post.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wirt
Posts: 37
Joined: Fri Feb 21, 2014 9:55 am
OLAP Product: Cognos TM1
Version: 10.1
Excel Version: 10

Re: Checking for coincidence

Post by Wirt »

Sorry for the confusion
I meant that when I insert an element in the dimension using the TI, I can not insert two identical elements in one dimension. So I can not keep track of the same elements.
You wrote earlier:
<< Use a TI process that evaluates the cells, and for example create a temporary dimension in which you insert the text entries.
Check if the entry already exists in de dimension (DIMIX function) >>
I can not do "Check if the entry already exists in de dimension (DIMIX function)"
Because in the dimension can not be two identical elements.
For this reason, I wrote that did not understand your advice, how to check two identical elements in one dimension
Thank
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Checking for coincidence

Post by Wim Gielis »

Like I wrote, in the Metadata ta, check if the element already exists or not:

Code: Select all

If( Dimix ( 'Dimension', 'Element' ) = 0 );
#does not exist yet, add it
DimensionElementInsert( 'Dimension', '', 'Element', 'N');
Else;
# here you have the case of a duplicate value, take action ! like deleting the cell value for example
EndIf;
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wirt
Posts: 37
Joined: Fri Feb 21, 2014 9:55 am
OLAP Product: Cognos TM1
Version: 10.1
Excel Version: 10

Re: Checking for coincidence

Post by Wirt »

Thanks, I'll try to use it
Post Reply