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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
harsha
Creator
Creator

how to save data in CSV with a condition

Hi Team,

I'm working in Qliksense and generated some flags based on some conditions. 

I want to store the data in a local folder. 

I'm able to store entire table STORE Sample INTO lib://Test/Check_1_Test_Export.csv (txt);

however I have a column like below which has "WithDecimal" or "WithoutDecimal" and I want to store/save into CVS or XLSX where Check_1_Flag is 'WithoutDecimal'?

Dec.png

how to save only WithoutDecimal in CSV?

11 Replies
harsha
Creator
Creator
Author

hi, pls use this sample excel 

uroboros
Creator
Creator

Hi @harsha  I believe that you have two problems.

First your flag, doesn't  work well, when I was checking your table, you have flag for data that not is decimal number.

Try something like this: if( isnull(even(Value), 'WithoutDecimal','Decimal') as _falg

And aditional, when you store use the code that @Kushal_Chawda  give you to store, that can will solve your dude.

I quote you @Kushal_Chawda:

Sample:

load *

FROM source

where  _Flag='WithoutDecimal';

STORE Sample INTO lib://Test/Check_1_Test_Export.csv (txt);

 

If you need store twice, use a for for your field, something like this:

for each _flag in fieldvaluelist(_flag)

dataTmp:

Load * resident  sample where _flag = '$(_flag)';

STORE dataTmp INTO lib://Test/Check_1_Test_Export_($_flag).csv (txt);

drop t able dataTmp;

next  _flag;

regards!