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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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
MVP
MVP

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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
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!