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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

a dual field

Hi,

The field Month is dual in my application - it is both numeric and string.

My task is to get a string value of the minimal Month selected by the user.

The formula min(Month) results in a numeriс value. How can I set it to give a string result?

Thank you in advacne,

Larisa

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Try

FirstSortedValue(DISTINCT Month,Month)

View solution in original post

15 Replies
Qrishna
Master
Master

monthname (min(Month)) or month(min(Month))

petter
Partner - Champion III
Partner - Champion III

Month( MakeDate(2015, Min(Month) ,1 ) )

swuehl
MVP
MVP

If you have an arbitrary text value and you don't want to re-apply a QV Date function:

=FirstSortedValue( Month, Month)

Anonymous
Not applicable
Author

Actually I have an arbitarary text. Month name is in Russian to it's a plane text.

But the function FirstSortedValue( Month, Month) doesn't work in my case. The result is '-'.

I'm quite sure that the field is dual.

antoniotiman
Master III
Master III

Try

FirstSortedValue(DISTINCT Month,Month)

Anonymous
Not applicable
Author

It works! Thank you!

How can I get the maximal value?

LastSortedValue doesn't work.

antoniotiman
Master III
Master III

FirstSortedValue(DISTINCT Month,-Month)

swuehl
MVP
MVP

I believe it should return the correct value, assuming Month being a dual value. Please double check.

Create a straight table chart with dimension Month, and an expression

=num(Month)

Please post the screenshot of that chart.

Anonymous
Not applicable
Author

Hi swuel,

I've experimented.

It works this way:

FirstSortedValue(distinct Месяц, Месяц) & ' – ' &FirstSortedValue(distinct Месяц, Месяц, Count(distinct Месяц))

FirstSortedValue(distinct Месяц, Месяц) - gets the minimal month

FirstSortedValue(distinct Месяц, Месяц, Count(distinct Месяц)) - gets the maximal month


You and Antonio helped. Thank you!