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: 
ol_dev
Creator
Creator

Qliksense: Is it possible to use Min/MaxString to find the first/last available values?

Hi,

We recall in Qlikview, it was possible to find the first/last item in alphabetic order from a field/dimension using MinString or MaxString function. Qliksense has a similar functionality, but it behaves differently that if any values are selected, then it only looks the currently selected values.

For instance, assuming the field Month has values 1-12, MinString(Month) will return 1 if nothing is selected, but if I select the months 3, 4 and 5, it will return 3 instead of 1. The below screenshots demonstrate this undesirable behavior from Qliksense.

Screenshot 1: Month field when unselected(the min value is 1)

ol_dev_0-1740515459396.png

Screenshot 2: Month field with (3, 4, 5) selected(the min value becomes 3!)

ol_dev_1-1740515522122.png

 

However, I would need it to still fetch the first/last item from all available/possible values, rather than from a list of currently selected values. How to achieve this with MinString or MaxString? Or is it not possible at all? Please help. 

Labels (5)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

If your values are numeric values then you can use min() or max() functions

Try Min({1}MonthNum) and Min({1}MonthNum)  to ignore any selection made to the data model.

View solution in original post

3 Replies
Vegar
MVP
MVP

If your values are numeric values then you can use min() or max() functions

Try Min({1}MonthNum) and Min({1}MonthNum)  to ignore any selection made to the data model.

ol_dev
Creator
Creator
Author

@Vegar 

Thx, the solution works. Btw we actually need to deal with both numeric and text fields, just in this example it happens to be numbers. 

ol_dev
Creator
Creator
Author

@Vegar 

With this being said, do you know what values Qliksense selects by default for single-select fields(those one and only one selection fields)? I thought it would select the item with lowest numeric/alphabetic order, but it seems to select whichever item currently selected when I last save the Qliksense app. I do not understand this behavior, as the item list is different across different environments(dev, stg and prod). Is there a way to make Qliksense choose a default value for single-selection fields in a better way? Thanks.