Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Choose latest timestamp with trigger not working

Hi,

I try to set my latest timestamp as default with a "Select in Field" trigger from a button. I've seen some posts about the topic, but could not solve my case anyway.

My field is named TAG_TIMESTAMP. I've set Field = TAG_TIMESTAMP and Search String =Max({1}TAG_TIMESTAMP) . But when I click, it doesn't change which  TAG_TIMESTAMP that is chosen.

I tried also the enable condition, and that works fine with expression: Max({1}TAG_TIMESTAMP)<>GetFieldSelections(TAG_TIMESTAMP). Both Expressions gives numeric value: 41327,446388889 (when I choose the latest tag in my list box manually).

Anyone got any idea what I could try to make the trigger work?

Regards,

Tom Arne Sivertsen

1 Solution

Accepted Solutions
whiteline
Master II
Master II

Hi.

There are two problems:

1) Max returns just number discarding text representation of TAG_TIMESTAMP.

2) TAG_TIMESTAMP has different text format by default than that is used in listbox.

The right text format works fine for selection (just use this expression in a button action):

=Timestamp(Max({1}TAG_TIMESTAMP),'DD.MM.YYYY hh:mm:ss')

View solution in original post

3 Replies
Not applicable
Author

Attached example file illustrating my issue.

Extra info: When I disable "Always one seleted", the button action is that it unselects the one tag that I might have selected before... Seems to me that it somewhat cannot find the Max({1}TAG_TIMESTAMP).

Any help apprecieted.


Regard,

Tom Arne Sivertsen

whiteline
Master II
Master II

Hi.

There are two problems:

1) Max returns just number discarding text representation of TAG_TIMESTAMP.

2) TAG_TIMESTAMP has different text format by default than that is used in listbox.

The right text format works fine for selection (just use this expression in a button action):

=Timestamp(Max({1}TAG_TIMESTAMP),'DD.MM.YYYY hh:mm:ss')

Not applicable
Author

Thanks. That worked. The Timestamp function helped (even without the date formatting).

- Tom Arne