Solved

Chart Axis

Posted on 2013-05-12
7
271 Views
Last Modified: 2013-06-14
I am having problems with the x axis on a bar chart

If the user picks Last Full Month - I want to show the data by day i.e. 01/05/2013, 02/05/2013. This works correctly

If the user picks Last Full Day I want to display the data  by hour i.e. 1:00,2:00 - at the moment this does not display in the correct order i.e. displays 1:00,10:00,11:00,12:00 instead of 1:00, 2:00, 3:00 etc.

My formula is as below

if {?datechoice} = 'Last Full Day' then totext(hour({Command.sentdatetime}),2,"" ) else
if {?datechoice} in [ 'Last Full Month'] then totext(cdate({Command.sentdatetime}),'dd/MM/yy' )

Is there a way I can correct this to show it in the right order?

Using CR2008
0
Comment
Question by:halifaxman
  • 3
  • 2
  • 2
7 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 39160353
Try

ToText ({Command.sentdatetime}),'yy/MM/dd' )


mlmcc
0
 

Author Comment

by:halifaxman
ID: 39161543
Thanks for the answer

The data for day works correctly i.e. totext(cdate({Command.sentdatetime}),'dd/MM/yy' ) - this displays in the correct order 01/05,02/05 etc

The data for hour totext(hour({Command.sentdatetime}),2,"" ) - does not display in the correct order, this displays  1:00,10:00,11:00,12:00  etc. I need it to display as 1:00,2:00,3:00 etc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39161629
Try

totext(hour({Command.sentdatetime}),"00:00" )

mlmcc
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:halifaxman
ID: 39161701
Tried the above, got the error

Bad number format string
0
 
LVL 34

Expert Comment

by:James0628
ID: 39164099
If you just want the hour, without the minutes, but want to include ":00" for the minutes (as in your examples), you can use:

totext({Command.sentdatetime},"hh:00")

 Or, to get just the hour:

totext({Command.sentdatetime},"hh")


 Note that I didn't use the Hour function.  ToText is extracting the hour from the datetime and formatting it.

 Interestingly, ToText doesn't like a ":" in a format string for a number (like the result of the Hour function).  That's why you got an error on mlmcc's suggestion.  But it allows it when formatting a datetime, including "hh:00" (which gives you the hour, followed by ":00").

 James
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39164667
Try

totext(hour({Command.sentdatetime}),"00" ) + ":00"

mlmcc
0
 
LVL 34

Expert Comment

by:James0628
ID: 39167537
Yeah, that would work too.  Never thought of that.  :-)

 James
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now