cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Applasaurus
Helper I
Helper I

subtract value on concatenated value

I've converted date and time picker value into text as break time is a choice/list and nothing seemed to be working when I left them as values. So now i've been able to get the values for From and To showing correctly but when i add the breaktime it's disregarding the From and To time and leaving the breaktime as a minus.

 

Concatenate(Label7.Text,":",Label8.Text) - Value(Label5_1.Text)

9 REPLIES 9
Anonymous
Not applicable

Could you explain a little more on what exactly you're trying to do? It looks like you're trying to subtract some value from a time value that you're building with Concatenate(). Is that correct?

Hi @Anonymous,  Yes that is what i'm trying to do

Anonymous
Not applicable

You can use TimeValue() like this

TimeValue(Concatenate(Label7.Text,":",Label8.Text))

Then add the subtraction like this

 

TimeValue(Concatenate(Label17.Text,":",Text(Value(Label8.Text) - Value(Label5_1.Text))), "en-US")

 

Example:

TimeValue(Concatenate("10",":",Text(Value("30") - Value("15"))), "en-US")

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Thanks @Anonymous  but I'm getting the following error

 

The function 'Value' has some invalid arguments

 

within the datacardvalue I've added this formula

Anonymous
Not applicable

Did you copy the formula exactly or modify it? I'm not getting any errors on my test.

@Anonymous  copied the formula as it is and getting the same error message. Also modified it after getting the error from the copy and paste.

Anonymous
Not applicable

Could you send a screenshot of the error with as much detail as possible?

@Anonymous 

 

Thought that it might be best if I show you whats going on that could help solve the matter.

 

The date and times are the work time from and to. Under that in yellow is the total time (309) - DateDiff(DateTimeValue(Label2.Text),DateTimeValue(Label4.Text),Minutes) The second yellow text is the minute value (9) - Mod(Label5.Text,60)

The blue text (5 - Label7) is the total hours - RoundDown(Sum(Label5.Text / 60),0) //& Mod(Label5.Text,60)

The second blue is the Total time - Concatenate(Label7.Text,":",Label8.Text)  {This is not used, this is only there so  that I can check that the calculation is correct, once I'm happy I'll remove it}

The red text is the selected value from the list (28) - Value(DataCardValue8_1.Selected.Value)

 

Capture1.jpg

Then the white box is the formula you gave me - TimeValue(Concatenate(Label17.Text,":",Text(Value(Label8.Text) - Text(Value(Label10.Text))), "en-US") with the following error.

Capture.JPG

Anonymous
Not applicable

Sorry for the delay in responding. I can't seem to find any errors in your formula. Have you double checked that the labels you're referencing are the hour and minute labels? Everything on my end is working still. Send a screenshot of the formula bar with the error and share as much detail about the error as you can.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,415)