Page 1 of 1

Checking for coincidence

Posted: Thu Aug 28, 2014 6:55 am
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

Re: Checking for coincidence

Posted: Thu Aug 28, 2014 7:27 am
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

Re: Checking for coincidence

Posted: Thu Aug 28, 2014 8:08 am
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

Re: Checking for coincidence

Posted: Thu Aug 28, 2014 8:25 am
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.

Re: Checking for coincidence

Posted: Thu Aug 28, 2014 10:38 am
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.

Re: Checking for coincidence

Posted: Thu Aug 28, 2014 10:39 am
by Wirt
Maybe I have something wrong did, but in a dimension are not created the same elements

Re: Checking for coincidence

Posted: Thu Aug 28, 2014 10:42 am
by Wirt
I had in mind when I make a measurement with a TI

Re: Checking for coincidence

Posted: Thu Aug 28, 2014 12:01 pm
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.

Re: Checking for coincidence

Posted: Thu Aug 28, 2014 12:21 pm
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

Re: Checking for coincidence

Posted: Thu Aug 28, 2014 1:04 pm
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;

Re: Checking for coincidence

Posted: Thu Aug 28, 2014 1:08 pm
by Wirt
Thanks, I'll try to use it