Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Script expression for current month

Please,

How do I wirte in the edit script, an expression for the current month. So that I can create a button object for a selection of current month only.

Please maximum help is needed

Dan

Tags (2)
1 Solution

Accepted Solutions
Not applicable

AW:Re: Script expression for current month

Hi,

if you want you can try it with an other idea.

1. Load an additional Field with


Load
...
inmonth(<DateField>,Now()) as ActualMonth
...
FROM...


2a. Create the Button, and as Action select "Select in Field"

2b. as Field select "ActualMonth" or whatever you have named that field

2c. as Search String take "1" (without the quotes)

Then it should select only the values in the actual month.

Have fun with QlikView

AlexSmiley Happy

11 Replies
MVP
MVP

Script expression for current month

Hello Dan,

You can always use something like:

Num(Month(Today()))


To get the current month number.

Not applicable

Script expression for current month

Thanks Miguel,

Then how do I create a button object to select only the current month. Your help is appreciated

MVP
MVP

Script expression for current month

If you are using version 9, just create a new button object, go to actions -> add -> "Type" = selection and on the right list, select "Select in field". You will be asked for the field name you want to search and the Search String, which is

=Num(Month(Today()))
(note the "=" before the expression).

And that's it!

Not applicable

Script expression for current month

Sorry I'm disturbing you so much. What do I type in the "Field" in the "Actions" tab of the button properties?

Also, is there any need for anything in the enable conditions?

Not applicable

AW:Re: Script expression for current month

Hi,

if you want you can try it with an other idea.

1. Load an additional Field with


Load
...
inmonth(<DateField>,Now()) as ActualMonth
...
FROM...


2a. Create the Button, and as Action select "Select in Field"

2b. as Field select "ActualMonth" or whatever you have named that field

2c. as Search String take "1" (without the quotes)

Then it should select only the values in the actual month.

Have fun with QlikView

AlexSmiley Happy

Not applicable

Script expression for current month

my suggestion is :

RUN MACRO it will solve all problems.

In macro is where u will use vbscript coding.

Hope u will b fine. Wink

MVP
MVP

Script expression for current month


dan wroteSmiley Frustratedorry I'm disturbing you so much. What do I type in the "Field" in the "Actions" tab of the button properties?


Your Month Name Field or Date Name Field.


dan wrote:Also, is there any need for anything in the enable conditions?


As far as I understand you just want to make a button to make selection equal to current month. So no, it doesn't. Well, depending on your chart, but that would be a different question.

Not applicable

AW:Re: Script expression for current month

Hi I tried the inmonth thing, but it says, Error: inmonth takes 3-4 parameters.

what do i do?

Not applicable

AW:Re: AW:Re: Script expression for current month

Sorry it was

inmonth(<Datefield>,now(),0) (see help for more information)

AlexSmiley Happy

Community Browser