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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
mikael-c
Contributor III
Contributor III

set analysis on map color expression

I'm using an expression to color points on a map.

In the following expression, station_timestamp is a timestamp (!) and station_color is a hexadecimal color code (generated during load) and both come from the same table. The variable vActualTimestamp is the maximal timestamp (closest to the actual time) at which data is retrieved, and is simply max(station_timestamp).

=if(station_timestamp = vActualTimestamp, station_color)

The expression works as expected and when I click a point on the map, the color expression also works without a problem. However, when I click data in a table (that is linked to the map), the point color becomes gray. I suspect it would work if I could manage to rewrite the expression with set analysis. I've tried a couple of things but I don't seem to make it work. How should I do it?

Things i've tried:

=if({1} station_timestamp = vActualTimestamp, {1} station_color)

=if(only({1} station_timestamp) = vActualTimestamp, only({1} station_color)

=aggr(if(only({1} station_timestamp) = vActualTimestamp, only({1} station_color), station_color)

and other variations.

Thanks!

Edit:

For the expression to work, I also had to add in the field of the layer =if(station_timestamp = vActualTimestamp, station_id) to show points and attributes. station_id is a field from the same table as station_timestamp and station_color but also links this table to 2 other tables.

0 Replies