Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
tamilarasu
Champion
Champion

Variable evaluation for excel sheet name

colorful-hello-text-smiley-emoticon.gif

I am taking sheet names by looping through excel workbooks. After that i need to replace the double single quotes with just a single quote. I have tried the below code but its not working.

My vSheetName  value is Apr''20. After replace it should be Apr'20

Table:

Load *

From $(File)

(ooxml, embedded labels, table is $(vSheetName), filters(

Remove(Row, RowCnd(CellValue, 1, StrCnd(null)))));

I have tried below:

Table:

Load *

From $(File)

(ooxml, embedded labels, table is $(replace(vSheetName,chr(39)&chr(39),chr(39))), filters(

Remove(Row, RowCnd(CellValue, 1, StrCnd(null)))));

Could anyone correct me?

8 Replies
sushil353
Master II
Master II

Hi,

Try $(chr(39)&Purgechar(vSheetName,'""')&chr(39) )

or $(=chr(39)&Purgechar(vSheetName,'""')&chr(39) )

HTH

Sushil

tamilarasu
Champion
Champion
Author

Not working.  

Capture.PNG

Siva_Sankar
Master II
Master II

Tamil,

Refer this thread https://community.qlik.com/thread/3915

tamilarasu
Champion
Champion
Author

Siva,

I have tried but not working as expected.

Siva_Sankar
Master II
Master II

can you upload your file?

Siva_Sankar
Master II
Master II

Tamil,

You already got the sheet names in single quotes in yesterday's post. May i know how you got the double quotes?? find the attachment

sushil353
Master II
Master II

Try this one: =SubField(vSheetName,'"',1)&chr(39)&SubField(vSheetName,'"',2)

tamilarasu
Champion
Champion
Author

Hi Siva,

Yes. I thought to tell u. But When I adapt the code to my original data it again showing as double quotes. I don't know the exact reason as I am getting synthetic keys and one weird error.

Let me explain my requirement in simple words (Say for example).

I have two excel files and two sheets in each workbook. I want to loop through the sheets and should concatenate the sheets (No join) . Finally I need a single table like below attached file.


Could you check and give me the code (I have tried to concatenate but I am getting synthetic key). I am new to this field, so I am not able to figure it out.


I really appreciate your help.content-and-happy-smiley-emoticon.gif !