BOB: Business Objects Board
Not endorsed by or affiliated with SAP

Register | Login 

Follow BOB on Twitter! 
Follow BOB on Twitter! (Opens a new window)  

General Notice: No events within the next 45 days.

Variable it not parsing


 
Search this topic... | Search Web Intelligence... | Search Box
Register or Login to Post    Forum Index -> Building Reports -> Web Intelligence  Previous TopicPrint TopicNext Topic
Author Message
SH3230
Principal Member
Principal Member



Joined: 25 Oct 2010

Posts: 446



PostPosted: Fri Sep 21, 2018 10:02 am 
Post subject: Variable it not parsing

Hello All,

I have an variable called V_Uptime_EST Without DayLight which returns the value as below:
[quote]04:54
13:09
16:24
04:40
08:03
23:24
23:40

I have created below variable

Code:
=If([V_Uptime_EST Without DayLight]>="08:00";"No";"Yes")



The problem is it is also including 23:40, 23:24 which is PM. I need to show only for after 8 AM

Thanks for your help

SH
Back to top
mikeil
Forum Associate
Forum Associate



Joined: 18 Feb 2015

Posts: 681
Location: Europe



PostPosted: Fri Sep 21, 2018 11:00 am 
Post subject: Re: Variable it not parsing

What type of variable is [V_Uptime_EST Without DayLight] ? It's important to determine the sort of comparison which will be carried out.

If it's a string, then you need 08:00 within double quotes; if it's a date/time, then you need to convert 08:00 to a time.

So you only want it between 8am and 12 noon? Then modify your if statement to say

if [V_Uptime_EST Without DayLight]>="08:00" and [V_Uptime_EST Without DayLight]<="12:00" then . . . .
Back to top
SH3230
Principal Member
Principal Member



Joined: 25 Oct 2010

Posts: 446



PostPosted: Fri Sep 21, 2018 12:46 pm 
Post subject: Re: Variable it not parsing

Hi Mikeil,


Thanks for your help. By the Can we show the these time AM And PM.

Thanks
SH
Back to top
mikeil
Forum Associate
Forum Associate



Joined: 18 Feb 2015

Posts: 681
Location: Europe



PostPosted: Fri Sep 21, 2018 2:48 pm 
Post subject: Re: Variable it not parsing

If it's part of a date/time field you can apply the formatdate] function.

If it's a string then check whether it's greater than "12:00". If you want to turn "13:45" into "01:45" you will have to extract the hour, subtract 12 and put it back.
Back to top
SH3230
Principal Member
Principal Member



Joined: 25 Oct 2010

Posts: 446



PostPosted: Fri Sep 21, 2018 3:42 pm 
Post subject: Re: Variable it not parsing

Thank you,

I am using the below code and it is turning 13:45" into "01:45".Please find screen shot attached.I want to show AM and PM also.Update date is date and Update time is time.

New Time
Code:
=FormatDate(RelativeDate((ToDate(Concatenation([Update Date];Concatenation(" ";[Update Time]));"MM/dd/yyyy hh:mm:ss a"));-4/24); "hh:mm:ss")
.

I want to show more than 8:00 AM and Less than equal to 12:00PM.

=If([New Time]>"08:00"And[V_Uptime_EST Without DayLight]<="12:00";"No";"Yes")

Thanks
SH


Last edited by SH3230 on Fri Sep 21, 2018 3:57 pm, edited 1 time in total
Back to top
mikeil
Forum Associate
Forum Associate



Joined: 18 Feb 2015

Posts: 681
Location: Europe



PostPosted: Fri Sep 21, 2018 3:51 pm 
Post subject: Re: Variable it not parsing

You can just add an "a" to the end of your statement
Code:
=FormatDate(RelativeDate((ToDate(Concatenation([Update Date];Concatenation(" ";[Update Time]));"MM/dd/yyyy hh:mm:ss a"));-4/24); "hh:mm:ss a")


Then your string will include am or pm, and your if statement will still work.
Back to top
SH3230
Principal Member
Principal Member



Joined: 25 Oct 2010

Posts: 446



PostPosted: Fri Sep 21, 2018 4:08 pm 
Post subject: Re: Variable it not parsing

Thanks it worked.

Now i want to use the variable using the below code as below

between 8AM and 9 AM.Is below code correct?how this variable will determine AM and PM? I need to show only between 08:00 AMto 9:00 AM

=If([Time]>"08:00"And[Time]<="9:00";"No";"Yes")

Thanks
SH
Back to top
mikeil
Forum Associate
Forum Associate



Joined: 18 Feb 2015

Posts: 681
Location: Europe



PostPosted: Sat Sep 22, 2018 8:43 am 
Post subject: Re: Variable it not parsing

It would probably be best to have another variable without the AM/PM to perform the comparison for that.

If you have 8:00 AM, 8:01 PM, 8:02 AM etc. it's a little tricky.

But if you have 8:00, 8:01, 20:00, 20:02 . . .then your if statement will work on that variable.
Back to top
isingdeadpeople
Forum Member
Forum Member



Joined: 28 Aug 2018

Posts: 5



PostPosted: Sun Sep 23, 2018 8:22 pm 
Post subject: Re: Variable it not parsing

Hi

Only putting this here, as it's an easy thing to miss:

Assuming that your time is in 24 hr time format (eg 8:00 and 20:00) and you want the time between 8:00AM and 9:00AM you'll need to include the equals sign in the first part of your formula, eg
Code:
=If([Time]>="08:00"And[Time]<="9:00";"No";"Yes")

otherwise, you'll miss out on 8:00:00 AM (eg exactly 8am, you'll get 8am and 01 seconds, but not 8am).
Back to top
Display posts from previous:   
Register or Login to Post    Forum Index -> Building Reports -> Web Intelligence  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 5 Hours
 
Jump to:  

Index | About | FAQ | RAG | Privacy | Search |  Register |  Login 

Get community updates via Twitter:

Not endorsed by or affiliated with SAP
Powered by phpBB © phpBB Group
Generated in 0.0323 seconds using 17 queries. (SQL 0.0030 Parse 0.0009 Other 0.0284)
CCBot/2.0 (https://commoncrawl.org/faq/)
Hosted by ForumTopics.com | Terms of Service
phpBB Customizations by the phpBBDoctor.com
Shameless plug for MomentsOfLight.com Moments of Light Logo