Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
help4qv123
Creator II
Creator II

Pick the distinct or first value

I need only the hrs....For eg:

1:00 it is 1hr, 1:30 it is showing 1hr which is wrong......so i need only the hours or it may like a distinct value...

Please check the sample attached.

Expected Result in Yellow.

1 Solution

Accepted Solutions
Kushal_Chawda

Please see the attached.

This is what you are looking for?

View solution in original post

11 Replies
PrashantSangle

Hi,

In this case you can try

subfield(timefield,':',1) as Hour

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
help4qv123
Creator II
Creator II
Author

I tried the same. Its not working.

help4qv123
Creator II
Creator II
Author

Wat you wrote is to bring the hours in 1 column. What i need is it should display only once when it is hours. When there is minutes added. It should not show. See the image attached .

jonathandienst
Partner - Champion III
Partner - Champion III

Perhaps you need to explain your requirements in more detail. To get the time without the minutes, you could use max dreamer's suggestion above, or something like:

     Round(timefield * 24, 1) & ' hrs'

    

or better still:

     Dual(Round(timefield * 24, 1) & ' hrs', Round(timefield * 24, 1))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Kushal_Chawda

Please see the attached.

This is what you are looking for?

help4qv123
Creator II
Creator II
Author

Hi Jonathan,

Thanks for your help. But the result which i am getting from you expression is which i already got.

My output should be

currently which i am getting is

I need the repeated 0hr,1hr, 2hr ....it should be shown 1ce. Like if there is any minute in before column then dont need that....

Kushal_Chawda

help4qv123‌ have you checked the application which I attached?

help4qv123
Creator II
Creator II
Author

no were u have sent

help4qv123
Creator II
Creator II
Author

Yes exactly...Thank You...can you remove the 0hrs.....