If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

DIMSIZ question - behavior unclear in documentation

Started by donap, 20 Nov 2017 01:34:13 PM

Previous topic - Next topic

donap

I am confused on if using DIMSIZ will give me the expected results.

My  entire dimension has 563 total elements.

The Leaf Level Elements - due to elements being added and others being deleted over time --
   have actual INDEX VALUES of 846, 848, 849 ...next month if one or 2 new items get added, their index values will be even higher...every month this number potentially could increase.

QUESTION IS:
  Will      vDimCount = DIMSIZ(vDim);
   return
vDimCount value of 563 total elements. or
            value of 849 Highest Index value ?  ???

Thanks

AJAYC

Hi

You will return 563, in your case.

Trying to control the index number is not easy, without putting lots of workarounds in your code. I wouldn't bother unless you have lots of time and really want to do it.

Getting the DIMSIZ is ideal when you want to do loops for the whole dimension.

HTH
Ajay

donap

What I thought, but not the answer I needed..  :(
 
I have need to loop through the dimension -- but how can I in this situation ??
I need to make sure I don't miss any elements ...



donap

Maybe --
This would work better if I used the Dimension as a Data Source --
Please correct me if I am wrong --
but using it as a Data Source (choosing the ALL subset) --
   Moving code to the DATA tab would be processed for EVERY Element... without needing the INDEX value to control a loop.

Am I wrong ?
Thanks !

AJAYC

Yes you can do this, but I'd do it in the METADATA tab

HTH
Ajay

donap

 Thank you.
Yes - putting the code in the Data Tab had no effect.
Metadata works great.
I am still unsure when to use Metadata vs. Data --
But trial and error is a great learning tool

AJAYC

Generally, when you have a datasource, you use the METADATA tab when you want to do anything with structures etc, and use DATA whenever you want to load data, for example to a cube, or attribute values.

HTH
Ajay

donap


donap

So -- I am looping through a Dimension (using the Dimension as a Data Source)
Then -- in the code - Applying Element Security by looping through the GROUPS:
Is this similar to loading an Attribute?? So DATA Tab -- or Metadata Tab? (it seems to work in both places !)

   vGroupsDim = '}Groups';
     vGrpsCounter = DIMSIZ(vGroupsDim);

     WHILE (vGrpsCounter > 0);
           vGroupElement = DIMNM(vGroupsDim, vGrpsCounter );           
           vGroupType = ATTRS(vGroupsDim, vGroupElement , 'Group_Type') ;
           if  (SCAN('ADMIN',vGroupType) = 0) ;
                    ElementSecurityPut('READ',sDim, vDivision_Element,   vGroupElement );
           endif; 
       
            vGrpsCounter = vGrpsCounter -1;
    # == End While Groups =====
     END;

AJAYC

Donap

You are adding a piece of data ie "READ", "WRITE" etc into a cube, albeit, a security cube - "}ElementSecurity_sDim" - so DATA tab is appropriate.

HTH
Ajay