cancel
Showing results for 
Search instead for 
Did you mean: 

Clear Script

Former Member
0 Kudos

Hi,

We need a clear process via a script (package) on the data. The user has to select the time periods at the beginning of the package. We created a clear process that is working on all time periods that have been selected. The problem is that the clear process should start on the second period and not on the first one.

Example:

Data before clear process:

Jan 2015     Feb 2015     Mar 2015     Apr 2015     May 2015     Jun 2015

125             255             70               56               55               85

User processes Package with time selection: Feb 2015 to May 2015.

The current result of our clear package is

Jan 2015     Feb 2015     Mar 2015     Apr 2015     May 2015     Jun 2015

125             0                 0                0                 0                  85

But as I described the clear process should start with +1 for the time window selected. So the result should be:

Jan 2015     Feb 2015     Mar 2015     Apr 2015     May 2015     Jun 2015

125             255                 0                0                 0                  85

Does anybody know how to solve this? Thanks in advance.

Regards

Derk

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Hi Derk,

Strange requirement...

"We created a clear process that is working on all time periods that have been selected." - user selects number of periods - correct?

But user can select something like 2015.02, 2015.04, 2015.07 etc... any mixture of months

May be it's better to ask user to select start and end months?

And then use something like:

*SELECT(%SMNTHTID%,[TIMEID],TIME,[ID]=$SMNTH$) //$SMNTH$ - from DM adv script

*SELECT(%EMNTHTID%,[TIMEID],TIME,[ID]=$EMNTH$) //$EMNTH$ - from DM adv script

*SELECT(%MNTHS%,[ID],TIME,[TIMEID]>%SMNTHTID% AND [TIMEID]<%EMNTHTID%)

In SELECT you can use >,<,>=,<=,=,<>

Vadim

P.S. In DM advanced script use PROMPT(COPYMOVEINPUT... AND TASK... MEMBERSELECTION

Former Member
0 Kudos

Hi Vadim,

thanks for the answer.

The user selects start and end period. Sorry that was not explained very well.

Regards

Derk

former_member186338
Active Contributor
0 Kudos

Then the question is answered:

*SELECT(%MNTHS%,[ID],TIME,[TIMEID]>=%SMNTHTID% AND [TIMEID]<%EMNTHTID%)

Hope you have properly maintained TIMEID for base members!

P.S. And if you are asking question about some script it's better to show the script you have tested....

Answers (0)