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: 
pra_kale
Creator III
Creator III

Can I save the out-put in one excel but in different sheets

Hi,

I have below given code which saved the files with a combination of Year and Channel name. Whether it is possible rather than creating a different different excel sheets can i saved all the out puts in single excel file but in different different sheets through script only.

I am attaching the application as well as supporting excel.

Can any one help me in this to modify the script.

Thanks in advance.

A:

LOAD Policy_no,

     Premium,

     Year,

     Month,

     Channel

FROM

(ooxml, embedded labels, table is Sheet1);

for i=1 to FieldValueCount('Channel')

let vChannel = FieldValue('Channel',$(i));

New:

NoConcatenate

LOAD '$(vChannel)' as Channel,

     Policy_no,

     Premium,

     Year as YEAR,

     Month

Resident A

where Channel='$(vChannel)';

for j=1 to FieldValueCount('YEAR')

let vYear = FieldValue('YEAR',$(j));

Final:

NoConcatenate

LOAD *

Resident New

where YEAR='$(vYear)';

STORE Final into E:\Qlikview\$(vChannel)_$(vYear).csv (txt);

DROP Table Final;

NEXT j

DROP Table New;

NEXT i

EXIT Script

1 Solution

Accepted Solutions
Kushal_Chawda

I think this can be done by macro only..

View solution in original post

4 Replies
Kushal_Chawda

I think this can be done by macro only..

pra_kale
Creator III
Creator III
Author

Ok...Thanks.

trdandamudi
Master II
Master II

You have to use macros,,,

pra_kale
Creator III
Creator III
Author

Ok. thanks..