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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Smeenakshi23
Creator II
Creator II

How to store Qvd on If condition

Hello,

I am fetching some recipients from db and storing it as .csv file( To use in Nprinting). if today day is Monday only Monday data should get stored. Vice versa for all other days.

I have achieved the above scenario using where( sequence No =1) condition while fetching data from db and storing that as a Monday.csv, tuesday.csv.

I need to have only one qvd(instead of Monday.csv ,Tuesday etc) which replaces the data on day condition.

How to achieve this in Qlikview.

1 Solution

Accepted Solutions
shraddha_g
Partner - Master III
Partner - Master III

Try:

IF(DAY(TODAY()=1)) THEN

Data:

LOAD *

FROM

(qvd)WHERE RPT_DAY= '1' ;

ENDIF

IF(DAY(Today()=2)) THEN

Data :

LOAD *    

FROM

(qvd)WHERE RPT_DAY= '2';

ENDIF

IF(DAY(Today()=3)) THEN

Data:

LOAD *

FROM

(qvd)WHERE RPT_DAY = '3';

ENDIF

store Data into C:\Qlikview\data.csv(txt);

EXIT Script

View solution in original post

7 Replies
shraddha_g
Partner - Master III
Partner - Master III

can you share your script?

You can Concatenate your new table with previous csv and then store new generated table in same csv

Anil_Babu_Samineni

Have a look here using loop FOR EACH ... NEXT

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Smeenakshi23
Creator II
Creator II
Author

IF(DAY(TODAY()=1)) THEN

NoConcatenate

Monday:

LOAD *

FROM

(qvd)WHERE RPT_DAY= '1' ;

store Monday  into C:\Qlikview\Data.csv(txt);

endif

IF(DAY(Today()=2)) THEN

NoConcatenate

Tuesday :

LOAD *    

FROM

(qvd)WHERE RPT_DAY= '2';

store Tuesday  into C:\Qlikview\data.csv(txt);

endif

IF(DAY(Today()=3)) THEN

NoConcatenate

Wednesday :

LOAD *

FROM

(qvd)WHERE RPT_DAY = '3';

store Wednesday  into C:\Qlikview\data.csv(txt);

ENDIF

EXIT Script

I tired this, but it doesn't work

madhumitha
Creator
Creator

Hi Soundarya,

This is exactly where you need to use Switch case statement.

please refer below qlikview help link

Switch..case..default..end switch ‒ Qlikview

Thanks!

shraddha_g
Partner - Master III
Partner - Master III

Try:

IF(DAY(TODAY()=1)) THEN

Data:

LOAD *

FROM

(qvd)WHERE RPT_DAY= '1' ;

ENDIF

IF(DAY(Today()=2)) THEN

Data :

LOAD *    

FROM

(qvd)WHERE RPT_DAY= '2';

ENDIF

IF(DAY(Today()=3)) THEN

Data:

LOAD *

FROM

(qvd)WHERE RPT_DAY = '3';

ENDIF

store Data into C:\Qlikview\data.csv(txt);

EXIT Script

Smeenakshi23
Creator II
Creator II
Author

Thanks a lot 🙂

Smeenakshi23
Creator II
Creator II
Author

hello Sharaddha,

I tried now and the above scenario is not working now. storing values for all the day(i.e) monday , tuesday and wednesday