Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts
my data set as below, every product has budget by month, however, i would like to get every month's budget, if the budget is empty, need to generate records with 0 as below expected. Please help.
After loading the DataSet table, you could use the following load script, assuming you want 12 months of data:
Products:
Load Distinct Product
Resident DataSet;
Months:
Load RowNo() as Month
AutoGenerate(12);
for k=1 to NoOfRows('Products')
Let vProduct = Peek('Product',k-1,'Products');
Concatenate (DataSet)
Load '$(vProduct)' as Product,
Month,
0 as Budget
Resident Months;
next k;
NoConcatenate
DataSetTemp:
Load Product,
Month,
sum(Budget)
Resident DataSet
Group by Product, Month;
Drop table DataSet;
Rename table DataSetTemp to DataSet;
Drop tables Products, Months;