Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Qlikview newby here. I have a trigger that is tied to the OnActivateSheet event. It uses a "Select in Field" action that selects a value from a field (Location), but currently the search string is hard-coded. Using the hard-coded search string, the trigger works as expected. What I want to be able to do is write and expression that gets the first (alphabetically) Location in the data, rather than hard-code the search string. So, if I have Locations A, B, and C, I want the expression to return A. The next time the data is loaded, there may not be an A value in the data. If the values are B, D, and E, I want the expression to return B. I have tried a number of expressions to try to get the first value, but have not been successful. I come from a background where functions like Min would normally return the value I'm looking for, but MIN seems to only apply numbers or dates in QlikView, and MinString seems to apply only in a chart context. Any suggestions?
I do believe the MinString function will work.
On your OnActivateSheet trigger add the action "select in field".
For "Field" enter the field name for example "Field1"
For the "Search String" use: =MinString(Field1)
This should return the lowest available string for you.
Good luck
Oscar
I do believe the MinString function will work.
On your OnActivateSheet trigger add the action "select in field".
For "Field" enter the field name for example "Field1"
For the "Search String" use: =MinString(Field1)
This should return the lowest available string for you.
Good luck
Oscar
Indeed, it did. Thanks! What confused me was that in order for hard-coding to work in the search string, you have enclose the string in parentheses (as in '(MyLocation)'), so I was creating the formula as ='(' & MinString(Location) & ')'. However, just the formula =MinString(Location) works. Again, thanks!