Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
danshanahan
Contributor
Contributor

Only Display Most Recent Data in Dropdown

Hey everyone.  I'm trying to create a visualization expression which only displays fields that are from the most recent data set.

Here's an example of my data:

idbusiness unitupdated at
123123bu12/01/2021
123123bu22/02/2021
222222bu32/02/2021

 

I'm wondering if there is a way to only return the business unit names from the most recent date?  In this case, I would only display bu2 and bu3.

I've tried a set expression and FirstSortedValue([business unit], [updated at]), but neither worked.

Any thoughts?  Thanks!

Labels (2)
4 Replies
edwin
Master II
Master II

normally i would create a variable that holds the date:
vMaxDate = date(max([updated at]))

then in set analysis:
{<[updated at]={'$(vMaxDate)'}>}

hope that helps

Chanty4u
MVP
MVP

you can use

SET DateFormat='DD/MM/YYYY';

Dimension: ID

Expression : Date(max([updated at]))

agigliotti
Partner - Champion
Partner - Champion

Hi @danshanahan ,

You could use the below expression for your listbox.

=Aggr( if( [updated at] = date(max( total [updated at])), [business unit] ), [business unit] )

I hope it can help.

Best Regards

danshanahan
Contributor
Contributor
Author

I was able to get this with a an aggregation and set expression:

=aggr(only({<uploaded_at = {"$(=Max(updated_at))"}>} business_unit),business_unit)

Thank everyone for the help!