on 2015 Nov 10 8:33 PM
how can i compare the sales value between two weeks ie current week and previous week also i want to post the value of the current week if its greater than the previous week into a different account member any suggestions
Request clarification before answering.
why i am confused is week is not a time dimension here , WK01, 02 03...we have another time dimension , the scenario is if the current week sales is more than the record sale , that week sales should be updated as the record sale figure , and record sales is a member in a custom dimension, sales is in account dimension
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| ENTITY | ACCOUNT | VERSION | TIME | WEEK | CUSTOMER TYPE | DATASRC | PPC | PCAT | RPTC | STAT | SUBDEPT | SIGNDDATA | |
| xyz | SALES | ACTWK | 2016.03 | WK15 | NOCTYP | LOAD_SS | I_NONE | NOPCAT | LC | RECORD SALES | NOSUBDPT | 10000 | previous record sales for this Profitcenter was this |
| xyz | SALES | ACTWK | 2016.03 | WK17 | NOCTYP | LOAD_SS | I_NONE | NOPCAT | LC | NOSTAT | NOSUBDPT | 10001 | now on wk17 sales was more than record sale |
| xyz | SALES | ACTWK | 2016.03 | WK17 | NOCTYP | LOAD_SS | I_NONE | NOPCAT | LC | RECORD SALES | NOSUBDPT | 10001 | then this record should updated as record sale |
| xyz | SALES | ACTWK | 2016.03 | WK15 | NOCTYP | LOAD_SS | I_NONE | NOPCAT | LC | RECORD SALES | NOSUBDPT | (10000-) | this should negate previous record sales |
In WEEK dimension you have to create property PREVWEEK and fill it with previous WEEK member!
Then:
*LOOKUP SameModel
*DIM PW:WEEK=WEEK.PREVWEEK
*ENDLOOKUP
*XDIM_MEMBERSET WEEK=%WEEK_SET% //current week
*XDIM_MEMBERSET TIME=2016.03
*XDIM_MEMBERSET ACCOUNT=SALES
*XDIM_MEMBERSET VERSION=ACTWK
*XDIM_MEMBERSET ENTITY=xyz
*WHEN WEEK
*IS * //Current week
*REC(EXPRESSION=(%VALUE%>LOOKUP(PW)) ? %VALUE% : 0, ACCOUNT=TARGETACCOUNT)
*ENDWHEN
week dimension will have week numbers with parent months for eg wk01 will be the children for jan, and TIME will be maintained as a property.
coming to data aspect data will be stored as below in model
TIME WEEK ACCOUNT STAT PRODUCT CAT .... SIGNEDDATA
2015.01 WK01 XXXX RCRDSALE HEALTHCARE ....10000
2015.02 WK02 XXXX NOSTAT PHARMA ----- 2000
Here the requirement is if the current week for eg wk02 value with NOSTAT is more than any of the previous week value with RCRDSALE , current wk value should be copied and posted as another transaction with stat member RCRDSALE for the specific entity, if its not greater than record sales , nothing to be done
*SELECT (%CURRENTWK%,CURRENTWEEK,VERSION,ID = "ACTWK")
*SELECT (%CURRENTMTH%,CURRENTMONTH,VERSION,ID = "ACTWK")
*LOOKUP FORECASTING
*DIM CWSALE:TIME = %CURRENTMTH%
*DIM CWSALE:WEEK = %CURRENTWK%
*DIM CWSALE:ACCOUNT = 41110000
*DIM CWSALE:CUSTOMERTYPE = NOCUSTOMERTYPE
*DIM CWSALE:PROFITCENTER = NOPROFITCTR
*DIM CWSALE:DATASRC = INPUT
*DIM CWSALE:PARTNERPC = I_NONE
*DIM CWSALE:PRODUCTCAT = NOPRODUCTCAT
*DIM CWSALE:RPTCURRENCY = LC
*DIM CWSALE:SUBDEPT = NOSUBDEPT
*DIM CWSALE:VERSION = ACTWK
*DIM CWSALE:MEASURES = PERIODIC
*DIM CWSALE:STAT = NOSTAT
*ENDLOOKUP
*XDIM_MEMBERSET CUSTOMERTYPE = NOCUSTOMERTYPE
*XDIM_MEMBERSET DATASRC = INPUT
*XDIM_MEMBERSET PARTNERPC = I_NONE
*XDIM_MEMBERSET PRODUCTCAT = NOPRODUCTCAT
*XDIM_MEMBERSET PROFITCENTER = NOPROFITCTR
*XDIM_MEMBERSET RPTCURRENCY = LC
*XDIM_MEMBERSET SUBDEPT = NOSUBDEPT
*XDIM_MEMBERSET VERSION = ACTWK
*XDIM_MEMBERSET TIME = BAS(2015.TOTAL)
*XDIM_MEMBERSET STAT = RCRD_SALES
*XDIM_MEMBERSET WEEK = NOWEEK
*XDIM_MEMBERSET MEASURES = PERIODIC
*XDIM_MEMBERSET ACCOUNT = 41110000
*WHEN WEEK
*IS NOWEEK
*REC(EXPRESSION = (%VALUE% < LOOKUP(CWSALE))?LOOKUP(CWSALE):0,WEEK = NOWEEK, STAT = RCRD_SALES , TIME = %TIME_SET%)
*ENDWHEN
*COMMIT
approach is to store the record sales in noweek member but what ever the value is its copieing to record sale
Something like this:
//%TIME_SET% - contains current week, weeks are base members
*XDIM_MEMBERSET TIME=%TIME_SET%
*XDIM_MEMBERSET ACCOUNT=SOMEACCOUNT1
*WHEN TIME
*IS * //Current week
*REC(EXPRESSION=(%VALUE%>[TIME].[TMVL(-1,%TIME_SET%)]) ? %VALUE% : 0, ACCOUNT=SOMEACCOUNT2)
*ENDWHEN
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 7 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.