zerout view

Post Reply
manu0521
Posts: 124
Joined: Wed Nov 26, 2014 8:32 pm
OLAP Product: IBM TM1, Planning Analytics
Version: PA 2.0.5
Excel Version: 2016

zerout view

Post by manu0521 »

Hi,

I am trying to create a view assign subset and then zero out in prolog

for the subset, i am doing the below code

Code: Select all

vDimension='Invoiced Partners';
vSourceSubset=vDimension| ' All N';
vMdx= '{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Invoiced Partners] )}, 0)}';
if(SubsetExists(vDimension,vSourceSubset)=1);
SubsetDeleteAllElements(vdimension,vSourceSubset);
Endif;
Subsetcreatebymdx(vSourcesubset,vMdx);
viewsubsetassign('Agency Sales DWH',vZeroOutSourceView,vDimension,vSourceSubset);
I am creating a subset with mdx to get all n and then assigning it to a view
on subsertcreatebymdx i am getting an error unable to register the subset .

Does this mean i cannot create a subsetcreatebymdx on prolog ?
how can i resolve this.
howard40116
Posts: 12
Joined: Tue Oct 02, 2018 5:35 am
OLAP Product: PAL
Version: PAL 2.0.4
Excel Version: excel 2010
Contact:

Re: zerout view

Post by howard40116 »

1.you can try to paste your mdx in the subset selector, validate your mdx is correct.

2.you can try to destroy your temporary subset or use subsetMDXSet.

Code: Select all


#1.SubsetDestroy

vDimension='Invoiced Partners';
vSourceSubset=vDimension| ' All N';
vMdx= '{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Invoiced Partners] )}, 0)}';
if(SubsetExists(vDimension,vSourceSubset)=1);
    SubsetDestroy(vdimension,vSourceSubset);
Endif;
Subsetcreatebymdx(vSourcesubset,vMdx);
viewsubsetassign('Agency Sales DWH',vZeroOutSourceView,vDimension,vSourceSubset);


#2.subsetMDXSet
vDimension='Invoiced Partners';
vSourceSubset=vDimension| ' All N';
vMdx= '{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Invoiced Partners] )}, 0)}';
if(SubsetExists(vDimension,vSourceSubset)=1);
    SubsetDeleteAllElements(vdimension,vSourceSubset);
    SubsetMDXSet(vdimension, vSourceSubset, vMdx);
ELSE;
    Subsetcreatebymdx(vSourcesubset,vMdx);
Endif;

viewsubsetassign('Agency Sales DWH',vZeroOutSourceView,vDimension,vSourceSubset);



manu0521
Posts: 124
Joined: Wed Nov 26, 2014 8:32 pm
OLAP Product: IBM TM1, Planning Analytics
Version: PA 2.0.5
Excel Version: 2016

Re: zerout view

Post by manu0521 »

stiill the same error :

vDimension='Invoiced Partners';
vSourceSubset=vDimension| ' All N';
vMdx= '{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Invoiced Partners] )}, 0)}';

if(SubsetExists(vDimension,vSourceSubset)=0);
SubsetCreate(vDimension,vSourceSubset);
Else;
SubsetDeleteAllElements(vdimension,vSourceSubset);
Endif;
Subsetcreatebymdx(vSourcesubset,vMdx);
viewsubsetassign('Agency Sales DWH',vZeroOutSourceView,vDimension,vSourceSubset);

Unable to register the subset . mx is validated in subset editor.
User avatar
PavoGa
MVP
Posts: 622
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.9.1
Excel Version: 2013 PAW
Location: Charleston, Tennessee

Re: zerout view

Post by PavoGa »

manu0521 wrote: Tue Nov 24, 2020 2:46 pm stiill the same error :

vDimension='Invoiced Partners';
vSourceSubset=vDimension| ' All N';
vMdx= '{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Invoiced Partners] )}, 0)}';

if(SubsetExists(vDimension,vSourceSubset)=0);
SubsetCreate(vDimension,vSourceSubset);
Else;
SubsetDeleteAllElements(vdimension,vSourceSubset);
Endif;
Subsetcreatebymdx(vSourcesubset,vMdx);
viewsubsetassign('Agency Sales DWH',vZeroOutSourceView,vDimension,vSourceSubset);

Unable to register the subset . mx is validated in subset editor.
The problem is you are trying to create the subset when it already exists. Change this:

Code: Select all

Subsetcreatebymdx(vSourcesubset,vMdx);

 # to this:
 SubsetMDXSet(vDimension, vSourceSubset, vMDX);
 
Ty
Cleveland, TN
Post Reply