Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

defining variables

hello,
I'm new to QlikView ,I defined a variable in variable Overview and i tried to display it on the dashbaord using a straight table but it didn't return any values, on the contrary it 's returning  the  script itself
example:
variable's name is : " EE1"
definition:
If
(date([Effective Date])> '30/05/2011' or date([Insured Date])> '30/05/2011',$(EE1) =0,
if
(date([Insured Date]) < '01/01/2011',
if
(date([Policy Expiry Date]) < '31/12/2010', $(EE1) =Round((date([Policy Expiry Date])-date([Insured Date]) +1 )/365,0.0001),
if
(date([Policy Expiry Date]) >= '31/12/2010', $(EE1) =Round((date('31/12/2010')-date([Insured Date]) +1 )/365,0.0001),
if
(date([Expiry Date]) < '01/01/2011',
if
(date([Policy Expiry Date]) < '31/12/2010', $(EE1) =Round((date([Policy Expiry Date])-date([Expiry Date]) +1 )/365,0.0001),
if
(date([Policy Expiry Date]) >= '31/12/2010', $(EE1) =Round((date('31/12/2010')-date([Expiry Date]) +1 )/365,0.0001),
if
(date([Insured Date])>= '01/01/2011', $(EE1) =0))))))))
and
if(date([Policy Expiry Date])> date([Expiry Date]),$(EE1) = $(EE1) * (-1))
and when i want to display the values of this variable it returns the script itself..
Please can anyone help me, thanks in advance.
Tags (1)
10 Replies

defining variables

Hi,

    Add = at the beginning of the script in variable.

Regards,

Kaushik Solanki

Not applicable

defining variables

hello Kaushik,

Thank you so much for your answer, yet I tried to apply your advice and here's the following :

the expression of the variable didn't show anymore which is good but still no values,did i miss something in the script ?

Thanking you so much in advance.

defining variables

Hi,

    I would say instead of using date in this way. i.e '30/05/2011' use

    makedate(2011,05,30)

    Change at every location, with respective date in makedate.

  

Regards,

Kaushik Solanki

Not applicable

defining variables

well Kaushik ,

i try it but i'm getting the same result, no values are show .

defining variables

Hi,

    Is it possible to upload the qvw file.

Regards,

Kaushik Solanki

Not applicable

defining variables

Hi Christelle,

First, Im not sure if it is necessary for you to use the $(EE1) expression in your variable definition. I woud think that it would be expected of you to use it when you call the variable in the front end.

  So, for instance, instead of writting

EE1 = If(date([Effective Date])> '30/05/2011' or date([Insured Date])> '30/05/2011',$(EE1) =0,else....... , you may just write:

EE1= If(date([Effective Date])> '30/05/2011' or date([Insured Date])> '30/05/2011', 0 ,else...

Secondly, I want to know, are you sure your current qlikview date format is 'DD/MM/YYYY' ? and not 'YYYY/MM/DD' for example?


rahulgupta
Contributor III

defining variables

Try this:

EE1=

If

(date([Effective Date])> '30/05/2011' or date([Insured Date])> '30/05/2011',0,

if

(date([Insured Date]) < '01/01/2011',

if

(date([Policy Expiry Date]) < '31/12/2010', Round((date([Policy Expiry Date])-date([Insured Date]) +1 )/365,0.0001),

if

(date([Policy Expiry Date]) >= '31/12/2010', Round((date('31/12/2010')-date([Insured Date]) +1 )/365,0.0001),

if

(date([Expiry Date]) < '01/01/2011',

if

(date([Policy Expiry Date]) < '31/12/2010', Round((date([Policy Expiry Date])-date([Expiry Date]) +1 )/365,0.0001),

if

(date([Policy Expiry Date]) >= '31/12/2010', Round((date('31/12/2010')-date([Expiry Date]) +1 )/365,0.0001),

if

(date([Insured Date])>= '01/01/2011', 0))))))))

Now take another variable:

EE2:

=if(date([Policy Expiry Date])> date([Expiry Date]),$(EE1) = $(EE1) * (-1))

Not applicable

defining variables

hello  ,

my current qlikview date format is 'DD/MM/YYYY'  and i also tried your method by removing the $(EE1)=....  but it didn't work.

Not applicable

defining variables

Please,

would it be possible for you to send us a QVW sample file?

Regards.

Community Browser