Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am trying to use the following as a dimension with no luck. What am I missing?
Thanks
time(date(Opportunity.CreatedOn,'YYYY/MM/DD hh:mm:Ss'),'hh TT') as Hour_Created
Example:
12 PM and then counting the number of opportunities created at 12 PM.
Hi Thom,
the trick is to let only the hour part of your timestamp count as a distinct value.
All formatting time functions (time, date, timestamp) do not change the numerical representation of your Opportunity.CreatedOn timestamp and therefore are not sufficient per se.
Therefore you have to round or truncate the timestamp to full hours or extract it's hour part.
Possible solutions are e.g.:
a not functioning example would be:
because this expression does not remove the differences of the minutes part of the timestamp.
hope this helps
regards
Marco
The expression seems ok if you try with
Eg:-
=Time(Date(now(),'YYYY/MM/DD hh:mm:ss'),'hh TT') //Same as your expression
The expression works perfect, but when I use Hour_Created as a dimension I get the following:
12 PM 1
12 PM 1
12 PM 1
Where is should be 12 PM 3
You must get only time fraction
time(frac(Opportunity.CreatedOn),'hh TT') as Hour_Created
or
time(round(frac(Opportunity.CreatedOn),1/24),'hh TT') as Hour_Created if your field holds minutes too
Plot list box of Opportunity.CreatedOn and in expression write code
Len( time(date(Opportunity.CreatedOn,'YYYY/MM/DD hh:mm:Ss'),'hh TT') )
Check it is 5 or 7 if it is 5 then ok but 7 need to check your load script.
hi
try this
date(date#(Opportunity.CreatedOn,'YYYY/MM/DD hh:mm:ss'),'hh TT')
It's 5
Nothing in Hour_Created.....
Try one of this
=Time(Timestamp(Opportunity.CreatedOn,'YYYY/MM/DD hh:mm:ss'),'hh TT') as Hour_Created
Or
=Time(Date(Opportunity.CreatedOn,'YYYY/MM/DD hh:mm:ss'),'hh TT')
Or
=Date(Date#(Opportunity.CreatedOn,'YYYY/MM/DD hh:mm:ss'),'hh TT')
OK, PLEASE TRY ACCORDING TO THIS
=date(date#(
now()
,'MM/DD/YYYY hh:mm:ss TT'),'hh TT')