Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use calendar to set a variable

Hi all,

I'd like a user to select a date from a calendar object, and then assign that value to a variable, eg. vDate.

Also, this date field will be an inputfield, so there won't necessarily be one assigned to the date field in the database.

Once the user has input/selected this date along with other values on a tablebox(which can be input/changed), I'd like to store it to a QVD.

Any idea?

Thanks!

8 Replies
sivarajs
Specialist II
Specialist II

Hi,

Select Calendar object and goto properties--> select field --->selcet variable u created(like VDate)

Goto edit script,then define like

Tmp:

Load '$(VDate)' as datefeild autogenerate(1);

store Tmp into Tmp.qvd;

Hope this helps.......

Regards,

Sivaraj S

Not applicable
Author

I am progressing a bit, and my records seem to be saving to my .xls doc., BUT

they don't seem to be returning what is contained in the excel file as :

NameGradeStartDateEndDate
fdfdsRegistrar24/01/201225/01/2012
joe schmoRegistrar05/03/2012

06/03/2012

Instead, my QV Chart is returning (just look at the 2 records for now):

1 fdfds Registrar 05/03//2012 06/03//2012
2 joe schmo Registrar 05/03//2012 06/03//2012
3 05/03//2012 06/03//2012
4 05/03//2012 06/03//2012
5 05/03//2012 06/03//2012
6 05/03//2012 06/03//2012
7 05/03//2012 06/03//2012
8 05/03//2012 06/03//2012
9 05/03//2012 06/03//2012
10 05/03//2012 06/03//2012

I think it's the way I'm joining the tables in the script .

Any help would be much appreciated ------- I think I've been looking at the scruipt for too long and my eyes are going out of focus.

Thanks!

sivarajs
Specialist II
Specialist II

i think in script u are using autogenerate(10)

This will store 10 times the variable value,make that as 1

Sivaraj S

Not applicable
Author

How could I go about changing this script slightly- probably using the iterno() function, so that it adds just 1 line under the current record, instead of a fixed amount eg.. autogenerate(10) or autogenerate(1).

So if I have 3 records, I like to add an extra row. ie. 3 and the 1 empty one.

My current script is:

Tmp:

Load
RecNo() as RecID,
'$(vStartDate)'
as StartDate,
'$(vEndDate)'
as EndDate autogenerate(10);

Any suggestions?

sivarajs
Specialist II
Specialist II

Hi Bean,

Sorry, Can u explain the problem Clearly

Sivaraj S

Not applicable
Author

I basically just want to be able to add an empty row or 1 extra row under the current 1.

I guess it needs a loop, instead of having a specific number of rows eg. autogenerate(10).

sivarajs
Specialist II
Specialist II

Hi,

I dont think we can add a empty row

But we can add a column in script itself or while loading qvd

Sivaraj S

Not applicable
Author

Is it possible to add a row using a macro?