Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
franklima1950
Contributor II
Contributor II

Converter campo Hora e Minuto

Preciso converter o campo abaixo para somente hora e minuto, por exemplo se tenho 10h59m preciso que fique 10:59,

caso seja 58m preciso que fique 0:58 !

No caso preciso fazer a média desses tempos, não sei se seria a melhor maneira

franklima1950_0-1653582487682.png

 

Labels (3)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

as below

temp:
Load
Timefield
,interval(alt(num(TextBetween('@'&Timefield,'@','h')),0)&':'&alt(num(trim(TextBetween('@'&Timefield,if(SubStringCount(Timefield,'h'),'h','@'),'m'))),0),'h:mm') as new_timefield
inline [
Timefield
1h
58m
10h 59m
3m
52m
9h 8m
];

 

qlikCommunity1.PNG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

as below

temp:
Load
Timefield
,interval(alt(num(TextBetween('@'&Timefield,'@','h')),0)&':'&alt(num(trim(TextBetween('@'&Timefield,if(SubStringCount(Timefield,'h'),'h','@'),'m'))),0),'h:mm') as new_timefield
inline [
Timefield
1h
58m
10h 59m
3m
52m
9h 8m
];

 

qlikCommunity1.PNG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
franklima1950
Contributor II
Contributor II
Author

It worked! Thank you very much!

But help me with one more thing, I need the negative hours to be positive and 1 more hour to be added to them, can you help?