Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create a big Concat string with values.....

Hi Folks

I have a requirement to create a single string in a text box that looks like a grid of data, so it will have a TransactionDate, Sum(Value) for that Date, Sum(Value2) for that date, followed by a line feed and then the next date. The purpose is to be able to embed this information into an email that will be sent as an alert.

So far:

ConCat(DISTINCT Date(TradeDate,'DD/MM/YY'),chr(10)) gives me a list of dates separated by line feeds

Concat(Aggr(Sum(Value1),TradeDate),chr(10)) gives me a list of the sum of value1 for each date, separated by line feeds

Concat(Aggr(Sum(Value2),TradeDate),chr(10)) gives me a list of the sum of value2 for each date, separated by line feeds

What I need though is to join these as one string, so was thinking of something like this:

Concat(

     DISTINCT Date(TradeDate,'DD/MM/YY')&

     ';   Value 1 = ' & Aggr(Sum(Value1),TradeDate)&

     ';   Value 2 = ' & Aggr(Sum(Value2),TradeDate)

     ,chr(10)

)

This is "almost" there, but what I get is each date twice, the first time with values and the second time without values and I'm wondering what the cause of this is and what it the potential solution to it. See picture below:

qv1.png

Any help would be appreciated.

Cheers,

Nigel.

1 Solution

Accepted Solutions
danielrozental
Master II
Master II

Try something like this

Concat(DISTINCT

     Aggr(Date(TradeDate,'DD/MM/YY')&

          ';   Value 1 = ' & num(Sum(Value1),'#,##0.00','.',',') &

          ';   Value 2 = ' & num(Sum(Value2),'#,##0.00','.',',') &

          chr(10)

     ,TradeDate)

)

View solution in original post

1 Reply
danielrozental
Master II
Master II

Try something like this

Concat(DISTINCT

     Aggr(Date(TradeDate,'DD/MM/YY')&

          ';   Value 1 = ' & num(Sum(Value1),'#,##0.00','.',',') &

          ';   Value 2 = ' & num(Sum(Value2),'#,##0.00','.',',') &

          chr(10)

     ,TradeDate)

)