Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

CONCAT

Good morning friends, how can I use CONCAT, eg

= Concat ('name', sum (qty))

Sem título.png

tks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try: ='Result = ' & sum(qty) & ' Exams'


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
jeffmartins
Partner - Creator II
Partner - Creator II

Hi rocha.qkw,

The concat function returns the aggregated string concatenation of all values of expression iterated over a chart dimension.

concat( Code, ';' )     

concat( FirstName&' '&LastName, ',' )

Regards

Not applicable
Author

thanks for the return, I need to put on the label of the chart a name before the result

 

= sum (qty) = 10

 

exams

 

Result: 10 Exams

 

it would

Not applicable
Author

Dear,

http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/19/the-concat-function

follow the link which will explain you clearly about concat function.

Thanks,

Mukram

Gysbert_Wassenaar

Try: ='Result = ' & sum(qty) & ' Exams'


talk is cheap, supply exceeds demand
Not applicable
Author

thanks for the return, I need to put an outcome + a name, eg

= sum (qty) * 10 = 250

result = 250 units

need to add the word units in the result.

tks

Not applicable
Author

thank you, you are to be congratulated

muito obrigado, você está de parabéns

Luis Claudio Rocha

subhash_gherade
Contributor III
Contributor III

Concat - script function

Concat() is used to combine string values. The script function returns the aggregated string concatenation of all values of the expression iterated over a number of records as defined by a group by clause.

Syntax:

Concat ([ distinct ] string [, delimiter [, sort-weight]])

Return data type: string

Arguments:

The expression or field containing the string to be processed.

ArgumentDescription
string

The expression or field containing the string to be processed.

delimiterEach value may be separated by the string found in delimiter.
sort-weight

The order of concatenation may be determined by the value of the dimension sort-weight, if present, with the string corresponding to the lowest value appearing first in the concatenation.

distinctIf the word distinct occurs before the expression, all duplicates are disregarded.

Examples and results:

Add the example script to your document and run it. Then add, at least, the fields listed in the results column to a sheet in your document to see the result.

ExampleResult

TeamData:

LOAD * inline [

SalesGroup|Team|Date|Amount

East|Gamma|01/05/2013|20000

East|Gamma|02/05/2013|20000

West|Zeta|01/06/2013|19000

East|Alpha|01/07/2013|25000

East|Delta|01/08/2013|14000

West|Epsilon|01/09/2013|17000

West|Eta|01/10/2013|14000

East|Beta|01/11/2013|20000

West|Theta|01/12/2013|23000

] (delimiter is '|');

Concat1:

LOAD SalesGroup,Concat(Team) as TeamConcat1 Resident TeamData Group By SalesGroup;

SalesGroup

East

West

TeamConcat1

AlphaBetaDeltaGammaGamma

EpsilonEtaThetaZeta

Given that the TeamData table is loaded as in the previous example:

LOAD SalesGroup,Concat(distinct Team,'-') as TeamConcat2 Resident TeamData Group By SalesGroup;

SalesGroup

East

West

TeamConcat2

Alpha-Beta-Delta-Gamma

Epsilon-Eta-Theta-Zeta

Given that the TeamData table is loaded as in the previous example:

LOAD SalesGroup,Concat(distinct Team,'-',Amount) as TeamConcat2 Resident TeamData Group By SalesGroup;

Because the argument for sort-weight is added, the results are ordered by the value of the dimension Amount.

SalesGroup

East

West

TeamConcat2

Delta-Beta-Gamma-Alpha

Eta-Epsilon-Zeta-Theta

http://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/StringAggregati...