Adding Unique elements to a subset
Posted: Fri Nov 11, 2011 7:43 pm
Hello,
I currently populate a subset with the elements (dates) that exist on the source file. The subset is used in a view and the view is used to identify cube records where the measure must be zeroed out before loading the new volume.
Date Product Volume
1/1/2011 A 888
1/1/2011 A 44
1/1/2011 B 21
1/2/2011 B 3
1/2/2011 C 10
In the MetaData Tab I delete all of the elements in the Subset
DimPeriod = 'VodDay';
subRef = 'zzTiVODPriceDates';
sOrderDay = TRIM(v_order_day);
#^^^ Delete All of The Elements From The zzTiVODPriceDates Subset In the VodDay Dimension
SubsetDeleteAllElements(DimPeriod, subRef);
In the Data Tab I populate the element in the SubSet
#^^^ Create the subset dynamically in VodDates Dimension
DimPeriod = 'VodDay';
subRef = 'zzTiVODPriceDates';
sOrderDay = TRIM(v_order_day);
#^^^ Update the zzTiVODPriceDates Subset in the VodDay Dimension with the date values from the File.
SUBSETELEMENTINSERT (dimPeriod, subRef, sOrderDay, 1);
This works; however, there are duplicate values in teh subset. Using the sample data provided above, there will be 5 records in the subset (3 for 1/1/2011 and 2 for 1/2/2011). The file I loaded recently has 150,000 records for the January activity.
How can I only add unique elements to the subset?
Thanks,
Walt
I currently populate a subset with the elements (dates) that exist on the source file. The subset is used in a view and the view is used to identify cube records where the measure must be zeroed out before loading the new volume.
Date Product Volume
1/1/2011 A 888
1/1/2011 A 44
1/1/2011 B 21
1/2/2011 B 3
1/2/2011 C 10
In the MetaData Tab I delete all of the elements in the Subset
DimPeriod = 'VodDay';
subRef = 'zzTiVODPriceDates';
sOrderDay = TRIM(v_order_day);
#^^^ Delete All of The Elements From The zzTiVODPriceDates Subset In the VodDay Dimension
SubsetDeleteAllElements(DimPeriod, subRef);
In the Data Tab I populate the element in the SubSet
#^^^ Create the subset dynamically in VodDates Dimension
DimPeriod = 'VodDay';
subRef = 'zzTiVODPriceDates';
sOrderDay = TRIM(v_order_day);
#^^^ Update the zzTiVODPriceDates Subset in the VodDay Dimension with the date values from the File.
SUBSETELEMENTINSERT (dimPeriod, subRef, sOrderDay, 1);
This works; however, there are duplicate values in teh subset. Using the sample data provided above, there will be 5 records in the subset (3 for 1/1/2011 and 2 for 1/2/2011). The file I loaded recently has 150,000 records for the January activity.
How can I only add unique elements to the subset?
Thanks,
Walt