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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
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

15 Replies
Anonymous
Not applicable
Author

Thanks!

MarcoWedel

another one:


Month(Date#(Min(Month),'M'))

regards

Marco

swuehl
MVP
MVP

Hi Larisa,

very,very strange that you need the DISTINCT qualifier here.

Just for interest, could you post a sample QVW with just that field?

antoniotiman
Master III
Master III

Hi swuehl,

from help guide (i'm sorry, original italian) FirstSortedValue()

Se più valori di espressione condividono lo stesso sort-order minimo, la funzione restituirà NULL.

So, You need DISTINCT clause.

swuehl
MVP
MVP

Hi Antonio,

I think in english it's:

If more than one value of expression share the same lowest sort-order, the function will return null.

I haven't considered that this will be enforced  even if the 'value of expression' is essentially the same. But you are right.

And I thought the results were strange based on my testing with distinct calendar fields, so it was not the correct test setting to be sure.

antoniotiman
Master III
Master III

Yes, this is misleading behavior.

Concat(Field,Separator,Sortvalue) has different behavior.

E.g. List of Products sorted by sales

Concat(DISTINCT Product,',',Aggr(NODISTINCT Sum(Sales),Product))

Regards,

Antonio