
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to append strings
Guys,
I am very new to QlikView.
I want to append strings in a for loop.
I am iterating a column in a table like this
Table:
LOAD *;
SQL SELECT t.column_name from column t
where t.table_id = $(tableid);
FOR j = 0 to (NoOfRows('Table'-1)
// at this point i need to concatenate column names along with some extra strings.
// pseudo code
// string = string + 'func1(column_name)'; // How to do this QlikView
next
Can anyone please tell me how to do it in QlikView?
I was trying Concat() like Concat(column_name,',') to see if it can at least to concatenation of column names but QlikView shows syntax error.
My real need is to do this // string = string + 'func1(column_name)';
Saurabh
Guys,
I have provided a sample data.
The output I need is two set of strings.
I need to iterate this one column in excel sheet and generate two strings.
1. Invoice, Bill, SalesOrder, Sales Receipt
2. Func1(Invoice, $(pwd)) as Func1Invoice, Func1(Bill, $(pwd)) as Func1Bill, Func1(SalesOrder, $(pwd)) as Func1SalesOrder, Func1(Sales Receipt, $(pwd)) as Func1Sales Receipt
Here 'pwd' is an other string whose value will be used here.
I hope this can help you guys to help me.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
'String1' & 'String2' & ExpressionYouWant // '&' is concatenation operator.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ramya
Try
let vstring = '$(vstring)' & 'MoreText' ;
Best Regards, Bill


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
little confused can you give us a Demo like or attachment with output,
generally if you want to concatenate two columns Simple write
Column1 & Column2
Ramya Saurabh output will be "RamyaSaurabh"
or
Column1 &'-'& Column2 will give you "Ramya-Saurabh"
also
Date
22/Sep/2013
Month(Date) & ' - ' & Year(Date) will give Sep - 2013
Might be helpful

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome to Qlikview. Please provide an example of what you want to achieve, e.g. sample input and desired output. This will make it easier for us to answer your question.
If you need each value in a certain column to have a fixed string appended, you could simply try:
LOAD
Column1 & 'Column1' AS Column1,
Column2 & 'Column2' AS Column2;
SQL LOAD ...
etc.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ramya,
You can use '&' . It is the concatenation operator in qlikview.
For eg.
'Book' & ' ' & 'Mark' as Col1 will result in Book Mark
'Hello' & 'Test' as Col2 will result in HelloTest
I think in your case
String & 'Your expression' as String1
should work.
Hope this helps!
It will be easier to provide exact solution if you post a sample app with small data.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Concat is to concat the fieldvalues within in one field like to combine morethan one rows.
It can be used in Group by in Script and you can directly use in Presentation in text objects or in charts.
To append strings use & operator between two strings.
Example: ColumnName & 'String' & ColumnName1
Hope it helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Bill!
it works.
Thanks to every one who spent some time to help me. it was all helpful and I learnt from each one of them
