Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a document and I used day() function to get the day of a date . so far every thing is fine but when I select a " day" from a list or any where in selection box instead of showing the day it shows for example "41 of 342 " as the value. Any body knows how we can show the real value?
Thanks,
Nima
That's sounds like your date field includes a time fraction. The day function will return the day but it still seems to include the time part. That would cause it to show '41 of 342' instead of returning only one value. In the script you need to use the floor function on the date, so the time parts are cut off: day(floor(MyDate))
Thanks for replying but it did not fix the problem.
I posted a doc.
Thanks
Ok, I see what's happening. Day(RECEIVED_DATE) returns the day of the month of RECEIVED_DATE. That means that 4/01/09, 4/02/09, .... 4/12/09 all return have the same value returned for Day(RECEIVED_DATE). Because you use Day(RECEIVED_DATE) as a calculated dimension you are selecting in the field RECEIVED_DATE if you select a value in the calculated dimension. You don't really select in a calculated dimension, but the dimension used in the calculated dimension. So you're not selecting one day, but all dates that have the day number you clicked on. And that's why you see '41 of 342'. The way to solve this is to create the Day dimension as a field in the script. So add a line Day(RECEIVED_DATE) as Day in the load statement that also loads the RECEIVED_DATE field.
Thanks for your solution but my client does not want to do any thing in script and I have to find a way to do it in set analysis.
Any suggestion?