Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

dzhsa001
New Contributor III

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

Re: Order of concatination

The third parameter of Concat takes the Sort Order

Concat - script function ‒ QlikView

Capture.PNG

View solution in original post

26 Replies

Re: Order of concatination

May be you can do this

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

Re: Order of concatination

The third parameter of Concat takes the Sort Order

Concat - script function ‒ QlikView

Capture.PNG

View solution in original post

dzhsa001
New Contributor III

Re: Order of concatination

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)

Re: Order of concatination

Are you trying to resolve this?

Comparison based on the group of fields

dzhsa001
New Contributor III

Re: Order of concatination

I have a similar issue

Re: Order of concatination

Oh okay...

dzhsa001
New Contributor III

Re: Order of concatination

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

Re: Order of concatination

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

dzhsa001
New Contributor III

Re: Order of concatination

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>?