back to forum.

Topic: Drill to weekday?

Topic by
franklin

2011-02-21
15:06

Drill to weekday?

Can I somehow enable drill to detail in the weekday distribution?

And a suggestion: Would be nice with a similar month distritbution

Reply by
kasper

2011-02-21
16:09
Hi franklin,

Sorry, currently it's not possible to drill down in the weekday distribution. But I think you're right, we should definately add that, so I will add a ticket for it for the next release.

Doing a month distribution should also be possible, yes. Actually it also IS possible, if you don't mind applying a small trick.

Select a date column, eg. the "ORDERFACT.REQUIREDDATE" column from the order db.
Add a Javascript transformer and apply this script:
function eval() {
return REQUIREDDATE.getMonth() + 1;
}
eval();
And add a regular value distribution on top of that. Then you're ready to go!

Reply by
franklin

2011-02-21
20:18
That trick did the job.

Actually, was just curious, so tried a few functions on the column value, lot of them didn't work, but doing a...
EMPLOYMENT_DATE.getDay()
...Seems to return the day as a number between 0 and 6. And then I can drill using the Value distribution analyzer. How do I figure out which functions I can call in the Javascript?

Reply by
kasper

2011-02-22
09:56
Hi franklin,

Pretty clever :) Actually the functions (or methods actually) available are based on the Java API of the value type. In your case the value is a Date, so the methods available are defined by the java.util.Date class. You can see them here:
http://download.oracle.com/javase/6/docs/api/java/util/Date.html

Other common values types are java.lang.Number, java.lang.String and java.lang.Boolean.

Reply by
beno

2011-02-23
17:24
+1 for having the drill to detail available directly in the weekday distributino. Maybe you should simply broaden the scope of that analyzer to also include months?

You need to be logged in to participate

In order to post your own comments on this topic, you need to be logged in.

Username:

Log in by clicking the login link at the top of the screen

 

Go back to forum.