|
发表于 2014-3-20 07:29:31
|
显示全部楼层
Hello to all,
thanks for the feedbacks and sorry my late reply.
I was able to do this with a second TI Process after creating the dim (the dim has an attribute with the product segment previously loaded with a file)
In this 2nd TI process i've placed this code:
Code: ################################ SUBSET <Subset name>################################
i = 1;
While (i <= DimSiz('<Dim_Name>'));
### Determina Nome do elemento da dimens茫o ###
dimelement=DimNm('<Dim_Name>', i);
### Determina o nome do <Subset name>para o elemento ###
subex=Attrs('<Dim_Name>',dimelement,'<Attribute_name>');
## Update do subset existir e apenas para elementos que n茫o existam ##
If(SubsetExists('<Dim_Name>',Attrs('<Dim_Name>', dimelement, '<Attribute_name>'))=1);
top=SubsetGetSize('<Dim_Name>', Attrs('<Dim_Name>', dimelement, '<Attribute_name>'));
count=1;
SubElemExists=0;
while ((count<=top)%(top=0));
if(SubsetGetElementName('<Dim_Name>', Attrs('<Dim_Name>', dimelement, '<Attribute_name>'), count)@=dimelement);
SubElemExists=1;
endif;
count=count+1;
end;
if(SubElemExists=0);
numelement=SubsetGetSize('<Dim_Name>',Attrs('<Dim_Name>',dimelement,'<Attribute_name>'));
SubsetElementInsert('<Dim_Name>', Attrs('<Dim_Name>', dimelement, '<Attribute_name>'), dimelement, numelement);
ENDIF;
SubElemExists=0;
### Cria莽茫o de subset e coloca莽茫o do artigo ##
ELSEIF ((SubsetExists('<Dim_Name>',Attrs('<Dim_Name>', dimelement, '<Attribute_name>'))=0)&(Attrs('<Dim_Name>',dimelement,'<Attribute_name>')@<>''));
## Cria o subset ##
SubsetCreate('<Dim_Name>',Attrs('<Dim_Name>',dimelement,'<Attribute_name>'));
## Insere elemento no subset ##
numelement=SubsetGetSize('<Dim_Name>',Attrs('<Dim_Name>',dimelement,'<Attribute_name>'));
SubsetElementInsert('<Dim_Name>', Attrs('<Dim_Name>', dimelement, '<Attribute_name>'), dimelement, numelement);
Endif;
i = i + 1;
End;
Hope it helps if someone needs something like this.
Thanks again for the ideas |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|