Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Can Concat function take 'Load Order' as an argument?

Hi,

my function is as follows:

=Concat(DISTINCT Month, ', ')


Be default the result is sorted in an alphabetic order - from A to Z.


I'd like to sort it by load order, so that Jan should come first.


I've found out the general description. It is possible to add a sort_weight.

concat([{set_expression}] [ distinct ] [ total [<fld {, fld}>]] expression[, delimiter[, sort_weight]])


But how exactly can define that sort_weight should equal load order?

Thank you in advance,


Larisa

1 Solution

Accepted Solutions
maxgro
MVP
MVP

maybe

add a rowno() as id when you load the months

use id as sort weight

View solution in original post

10 Replies
maxgro
MVP
MVP

maybe

add a rowno() as id when you load the months

use id as sort weight

sunny_talwar

If month is created using a Month() function, I think this should also work:

=Concat(DISTINCT Month, ', ', Month)


Because Month is a dual function which is both Numeric as well as string.


HTH


Best,

Sunny

Anonymous
Not applicable
Author

Hi,

Actually, the name of the field in my model is the Russian equivalent of Month - Месяц.

I translated it in order to give you a clear example.

I'm I right that then it won't work?

Larisa

sunny_talwar

Name of the field doesn't matter, what matter is are you using a Month() function to calculate the month or is it a text string? If it is a text string then you can go with the solution provided by Massimo Grossi‌, but if it is created using a month function then what I have suggested should work.

Note: Massimo's solution will work in the second scenario also

Best,

Sunny

Anonymous
Not applicable
Author

I see your point. Actually, the names of the Months are of a string format because they should be in Russian.

Nevertherless, thank you!

sunny_talwar

No problem. The way to check, if you want to check, that if your Month Names are actually text string or dates is to create a chart with Month as Dimension and =Num(Month) as Expression. If you see numbers in the expression column then those are actually dates, if you see - then they are text strings.

Best,

Sunny

Anonymous
Not applicable
Author

I'd be greatful if you could tell me how I can convert a text field to a month format on the backfront.

I tried this way:

LOAD

Current_Month as Month(Current_Month),

...

It doesn't work.

Thank you in advacne,

Larisa

sunny_talwar

Try this:

LOAD DUAL (MonthField, Pick(Match(MonthField, 'List the name of the months in the correct order separated with commas (for example, Jan, Feb, Mar)'), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) as MonthField

Anonymous
Not applicable
Author

Thank you!

It works with a minor change.

There should be quotation marks for each month name: 'Jan', 'Feb', 'Mar'.