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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
annabergendal
Partner - Creator
Partner - Creator

Nested set expression needed?

Hi,

I have a set expression where I would like to count the value if the last value in time has service_activity.action 1 or 2.

The problem is how to make sure it is only the latest value that is checked?

=count ({$< service_activity.createtime={"$(=Max(service_activity.createtime))"}, service_activity.action={"2"} >+< service_activity.action={"1"} >}  service_activity.subscription_id )

If I have the following:

service_activity.createtime          service_activity.action          service_activity.subscription_id

2012-01-01                                 2                                        A

2013-01-01                                 1                                        A

2014-01-01                                 5                                        A

I get my expression to calculate 1, when I want 0. I only want to check whether the latest value (2014-01-01) is 1 or 2.

How can I do this?

Many thanks.

0 Replies