Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Not applicable

Variable in a dimension not working :-(

Hi All,

I have a dimension.. where vThisWeek is a variable

if (SalesWeek= vThisWeek,'Yes')

which works fine, but then I want to change it using a macro and hence want to use another variable i.e.

vReportNeeded =    vThisWeek OR SalesWeek = vLastWeek

and then have if( SalesWeek=vReportNeeded, 'Yes') but it doesn't seem to work and produces no figures.

I ant to throw various week values at it, hence the variable

Anyone any ideas please ?

Thanks in advance

Bob

1 Solution

Accepted Solutions
Highlighted
SunilChauhan
Esteemed Contributor

Re: Variable in a dimension not working :-(

use with $ sign

and in dimension  use like '$(Variable name)'

View solution in original post

4 Replies
Highlighted
Partner
Partner

Re: Variable in a dimension not working :-(

Hi, using macro you have to get and set value from variables, not using =

i put an example

good luck

get value from variable:

set vFromDateTransito = ActiveDocument.Variables("vFromDateTransito")

set value:

set ValorVariable = ActiveDocument.Variables("vTest2")      

          v = "1"   

          ValorVariable.SetContent v , true

Highlighted
Not applicable

Re: Variable in a dimension not working :-(

Hi thanks for the reply but it does nto help I am afraid.

I have a macro that sets the variable, but after it has set the variable the dimnesion will still not produce figures from it

Highlighted
SunilChauhan
Esteemed Contributor

Re: Variable in a dimension not working :-(

use with $ sign

and in dimension  use like '$(Variable name)'

View solution in original post

Highlighted
Not applicable

Re: Variable in a dimension not working :-(

How frustratiingly simple - thank you !! 🙂