Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

mov
Esteemed Contributor III

Reply to "Filling Date Variable..."

Rubens Rodrigues

Rubens,

I cannot post a reply to your Filling Date Variable automatically because I'm not a member of SAP group, hence a separate post...

You can define the variable at the beginning of the script:

vDate = date(today(), 'YYYYMMDD');

And, use it in the script:

Variables (

  [0SEM_CRD] (I = [0SEM_CRDATE].['$(vDate)'])),

From (ZITEMLQP2/Q_MP_FLXCX_0014_PREVQVIEW));

7 Replies
rrodriguesrr
New Contributor III

Re: Reply to "Filling Date Variable..."

Hi Michael,

I tried using those variables as shown, but I think it does not work under SELECT statement, since it's a QV variable. I guess QV Connector sends to BW a messed string value such as "$(vPullDate)" in instead of the date set in the variable (20140611).

I have tried to use an ABAP function called "sy-datum" but I think QV Connector sends it as a string too, and not a date function.

Tks,

Rubens

mov
Esteemed Contributor III

Re: Reply to "Filling Date Variable..."

QV variables work fine in the select statements (Oracle, SQL Server, etc.).  During the script execution, it is replaced with the variable value.  I use it all the time.

Take a look into the log file, you'll see how this part looks like.  I think you'll find a hint there.

mov
Esteemed Contributor III

Re: Reply to "Filling Date Variable..."

I just thought maybe there is no need for the single quotes here, just

Variables (

  [0SEM_CRD] (I = [0SEM_CRDATE].[$(vDate)])),

From (ZITEMLQP2/Q_MP_FLXCX_0014_PREVQVIEW));

rrodriguesrr
New Contributor III

Re: Reply to "Filling Date Variable..."

Michael,

I have tried:

Look at my script:

SET vDate = Date(today(), 'YYYYMMDD');

Tried:

Variables (

  [0SEM_CRD] (I = [0SEM_CRDATE].[$(=$(vDate))]))

Variables (

  [0SEM_CRD] (I = [0SEM_CRDATE].[$($(vDate))]))

Variables (

  [0SEM_CRD] (I = [0SEM_CRDATE].[$(vPullDate)])) --- This way does not work

Checking the log I have a blank value:

6/11/2014 4:18:40 PM: 0059   Variables (

6/11/2014 4:18:40 PM: 0060    [0SEM_CRD] (I = [0SEM_CRDATE].[]))

However, If I just use the same variable trought a text object, I can see the value.

Tks

Rubens

mov
Esteemed Contributor III

Re: Reply to "Filling Date Variable..."

Rubens,

You define variable as vDate, but call it as vPullDate which is not defined.  Or is it just a typo?.

In any case, what is in the Variable overview - do you see your variable name, and what is the value?

rrodriguesrr
New Contributor III

Re: Reply to "Filling Date Variable..."

Sorry, it was just a type mistake, I used vDate.

mov
Esteemed Contributor III

Re: Reply to "Filling Date Variable..."

I thought so.  Still the questions - after the reload, is there a variable vDate?  If yes, what's the value?

Community Browser