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

Concatenation of a field order by a value in a different field

Hello,

I've the following table:


   

FIELD A (NOKEY)FIELD B (NONOTA)     FIELD C ( RIGA)
LI11703020120117000000001XXX10
LI11703020120117000000001YYY20
LI11703020120314000000010AAA10
LI11703020120314000000010BBB20
LI11703020120314000000010CCC30

The concatenation of the FIELD B should follow the order of the FIELD C for the distinct value of the FIELD A


How do I give this indication to the function used? The function used is the following:


aggr (Concat (DISTINCT NONOTA, ''), NOKEY)

But I get a concatenation unordered for the field B and it's wrong.

I would like to have the following string in output AAABBBCCC  while I get the following string AAACCCBBB.


Thanks.

10 Replies
marcus_sommer

concat() had a third parameter for sorting but it must be a numeric one.

- Marcus

Not applicable
Author

Hi,

please try....

=NOKEY&NONOTA&RIGA

it will concat and all field.


Not applicable
Author

It's possbile to use a name of a field as a third parameter ?


If not, how can I order for the FIELD C ?


I do not understand what is the logic with which the strings are concatenale.

Not applicable
Author

I would concatenate only the value of the FIELD B for the distinct value of the field A order by FIELD C.

Not applicable
Author

could you please text an example on you real data which you posted, so I can understand

Not applicable
Author

This is a summary of the table that I read

   

FIELD A (NOKEY)FIELD B (NONOTA)     FIELD C ( RIGA)
LI11703020120117000000001XXX10
LI11703020120117000000001YYY20
LI11703020120314000000010AAA10
LI11703020120314000000010BBB20
LI11703020120314000000010CCC30

I would have a result like this

LI11703020120117000000001                              XXXYYY

LI11703020120314000000010                              AAABBBCCC

In same case I obtain this result:

LI11703020120314000000010                              AAACCCBBB

Thanks

Not applicable
Author

Hi,

I have used same formula, which you have applied and it is working fine.

=aggr (Concat (DISTINCT nota, ''), nokey)

please find the attachment.

marcus_sommer

Try: Concat (DISTINCT NONOTA, '', RIGA)


- Marcus

Not applicable
Author

Hi Rakesh, I've tried bue the problem is still present.

I don't understand how can I attach a file in the discussion, if is possible I attach a file that explain the problem.