Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
vireshkolagimat
Creator III
Creator III

Load data based on certain conditions in QV script

Hi,

I have some data in the below format. I want to load data only on specific day.

For example, if it is friday, i don't want to load the data but if it is monday i need to load the same data.

In chart i am able to achieve this using variable and weekday function. But this will not fullfil my requirement.

Can we do a similar thing in QV script while loading data.

Regards,

Viresh

In the below case, i want to load only header1 one information on Friday and Header1 & Header2 information on Monday

Header 1Header 2
Comments1Comments3
Comments2Comments4
6 Replies
sunny_talwar

So you don't want to reload the whole applicatipn on Monday? or you don't want to load a specific table on Monday? If it is for a specific table, you might be able to do this

If WeekDay(Today()) <> 'Mon' then

     TableName:

     LOAD [Header 1],

                [Header 2],

                ....

     FROM ....

ENDIF;

vireshkolagimat
Creator III
Creator III
Author

Hi, it works fine but it will leave a hypen '-', if the object is not found in the nprinting template. Any idea how can we avoide this '-' in the template.

thanks

sunny_talwar

I have very limited expertise in nPrinting, so won't be able to offer much on that front.

vireshkolagimat
Creator III
Creator III
Author

Hi, Can we create the objects based on the script or using macro. My requirement is if there is no data to show in a particular object, then i don't want that object(for ex table box) in the qvw file and it should be populated if there is a data show in that object.

I really don't know  if that can be possible but just curious to know.

thank for your support.

Regards,

Viresh

wallerjc
Partner - Contributor III
Partner - Contributor III

Viresh

this can be done in the 'Layout' tab under Conditional show condition.

Can you create a 'fake field', in your script e.g. "DateToday" then base your show condition based on this variable?

vireshkolagimat
Creator III
Creator III
Author

Hi, thanks for the suggestion.

I am using the below script in Layout tab -> conditional show

if(weekday(today())<>'Wed',1,0)

but the object is still showing in qvw file. Did i missed something.