Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
userid128223
Creator
Creator

if statement

I want to write if statement with time. (hh:mm)

I have a field dimension like below:

Time

00:25

02:44

18:25

00:00

In a pivot or straight table i just want show Time field if it is more then 00:00 otherwise make it null. Please show how.

9 Replies
Ralf_Heukäufer
Partner - Creator III
Partner - Creator III

if(Time='00:00',null(),Time)

Anil_Babu_Samineni

Null means you are going to kill those?

If(Time = Time(MakeTime('00:00'), 'hh:mm'), 'Null', Time)

OR

If(Time = Time(MakeTime('00:00'), 'hh:mm'), ' ', Time)

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
userid128223
Creator
Creator
Author

getting results in -decimals.

userid128223
Creator
Creator
Author

null means just keep the field empty. don't show anything.

Ralf_Heukäufer
Partner - Creator III
Partner - Creator III

if(Time='00:00',null(),Time(Time,'hh:mm'))

userid128223
Creator
Creator
Author

I am getting results in decimal format.

Anil_Babu_Samineni

Would you mind, Can you please provide sample?

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
userid128223
Creator
Creator
Author

1:00 is showing up as 4239.0416666667

Anil_Babu_Samineni

May be this?

If(Time = Time(MakeTime('00:00'), 'hh:mm'), ' ', Interval(Time/24/60/60, 'hh:mm'))

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