Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

YTD transformation 2

Status
Not open for further replies.

bittmapp

Technical User
Jul 21, 2003
56
0
0
US
Please explain to me how, if possible, to create a Year to Date transformation without having a 'transformation table' that stores the data in the warehouse.

Thanks,

bitt
 
Just a point of clarification, the year-to-date transformation table does not store the data that is being calculated. It just stores the mappings between a date, and the dates that occurred before it. So a YTD transformation table will look like this.

date ytddate
---- -------
jan 01 jan 01
jan 02 jan 01
jan 02 jan 02
jan 03 jan 01
jan 03 jan 02
jan 03 jan 03

i don't know of an expression that can solve your issue. but the ytd transformation is good because it can be used for ANY metric at ANY level.
 
Bittmapp,

You can create a simple date prompt [DT] and then create a filter [F1] with an 'advanced qualification' and 'custom expression' with an applysimple expression in it....something like this


(applysimple(&quot;year(#0),? DT) = applysimple(&quot;year(#0),[date attribute]@ID)) AND (applysimple(&quot;#0&quot;,[date attribute]@ID)<= applysimple(&quot;#0&quot;,? DT))

In a 'Nutshell' what this says is:

Give me the data that has the same year as the value entered into the prompt but make sure that the date is also less than or equal to the value entered into the prompt.



With a few additional applysimple statements this can also be used to create QTD and MTD. Let me know if you need additional information. I hope this helps.

-dinzana



 
Thanks Dinzana,

would you show me the additional applysimple functions you mentioned?

bitt
 
Something like this for QTD:

(ApplySimple(&quot;to_char((#0),'YYYYQ')&quot;, ?DT) = ApplySimple(&quot;to_char((#0),'YYYYQ')&quot;, [date attribute]@ID)) AND (ApplySimple(&quot;#0&quot;, [date attribute]@ID) <= ApplySimple(&quot;#0&quot;, ?DT))


And for MTD:

(ApplySimple(&quot;to_char((#0),'YYYYMM')&quot;, ?DT) = ApplySimple(&quot;to_char((#0),'YYYYMM')&quot;, [date attribute]@ID)) AND (ApplySimple(&quot;#0&quot;, [date attribute]@ID) <= ApplySimple(&quot;#0&quot;, ?DT))


Hope that these help,

dinzana
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top