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: 
Anonymous
Not applicable

Order of concatination

Hi,

I have a function that creates a string based on the results of the adjacent field via concatination. But, the issue is that the order is not preserved at the end.

Using this formula :

=Concat(TOTAL <School, Class> Aggr(If(Excellent > Good, 'yes', 0), Year, School, Class), '|')

Output is like:

img.png

Normaly, the result should be "yes|0|yes", but its "0|yes|yes".

Is it possible to somehow resolve this issue?

updated formula due to wrong field existence

1 Solution

Accepted Solutions
sunny_talwar

The third parameter of Concat takes the Sort Order

Concat - script function ‒ QlikView

Capture.PNG

View solution in original post

26 Replies
sunny_talwar

May be you can do this

=Concat(TOTAL <School, Class> Aggr(If(Excellent > Good, 'yes', 0), Year, School, Class), '|'), 'yes', Year)

sunny_talwar

The third parameter of Concat takes the Sort Order

Concat - script function ‒ QlikView

Capture.PNG

Anonymous
Not applicable
Author

Great! That's something I needed. I updated the formula, so at the end it should be:

=Concat(TOTAL <School, Class> Aggr(If(Excellent > Good, 'yes', 0), Year, School, Class), '|',Year)

sunny_talwar

Are you trying to resolve this?

Comparison based on the group of fields

Anonymous
Not applicable
Author

I have a similar issue

sunny_talwar

Oh okay...

Anonymous
Not applicable
Author

It is really strange way of solving this with string functions, but still it works.

sunny_talwar

Yup, the only thing with that post is that there are gaps in the year. so, it goes from 2011, 2012 to 2014... so I am not sure if just concat will work... but yes, it is def. an option

Anonymous
Not applicable
Author

stalwar1‌, I have one addition. What if the class field is conditional. Is it possible somehow to adapt the concatenation that in case of disabling the class field, it adapts for the <school, year>?