Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rahulken
Partner - Contributor
Partner - Contributor

Format of time from variable

Hi,

I have txt file contains variable declared in that file. I have assigned variable as "7" and it is working fine if I have to change it to "7:45" then it is not working. The variable should behave like time. Can any one please suggest me how to resolve it?

8 Replies
prma7799
Master III
Master III

Please share some sample app.

Anil_Babu_Samineni

I am assuming you are defining in Input Box, When you entered as time it consider as Time itself. You have to re modify that in Variable Itself. If i am wrong, You would explain little more

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
rahulken
Partner - Contributor
Partner - Contributor
Author

Hello Anil,

I have to compare the value in variable with datepart hours. If I provide value in variable as 7 it compares properly but if I take it  as 7:45 then it is throwing error about not specified ":"

Anil_Babu_Samineni

That's for i mention Qlikview gives the output as always our inputs only. If you have 7 as variable stored then how you are enter 7:45. Still not confirmed the reason. Can you release the key as you required (May be images) then we can talk about the troubleshoot

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
rahulken
Partner - Contributor
Partner - Contributor
Author

Now I change the value in variable as "7:45" and then while comparing it is showing error. I am trying to upload the scenario.

Anil_Babu_Samineni

Would you able to provide Scenario. And that include you have to declare single quotes for that, May be like '7:45'

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable

Give it in single quotes. It will work

vinieme12
Champion III
Champion III

use Time() with Time#()

time(time#(TheTime,'h:mm')) as TheTime

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