Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

sofiavaz
Contributor

Issue with a variable not working

Hi all,

I have this expression that is working exactly as I want while it is in a text box. However, when I define the expression as a variable it stops working! Do you have any idea why?

=if(GetFieldSelections(OrdItemInsDt)>0,

  (if(GetFieldSelections(OrdItemInsDt)<7,

    date(min(OrdItemInsDt))& ' to ' & date(max(OrdItemInsDt)),

  (if(Left(GetFieldSelections(OrdItemInsDt),3) = '',

  max({<Year-={$(=SubField(GetFieldSelections(OrdItemInsDt),'',2))}>} OrdItemInsDt),

  date(min(OrdItemInsDt)))& ' to ' & if(Left(GetFieldSelections(OrdItemInsDt),3) = '',

  max({<Year-={$(=SubField(GetFieldSelections(OrdItemInsDt),'',2))}>} OrdItemInsDt),

  date(max(OrdItemInsDt)))))),

  $(vLastInsDtWeek))

Thank You!

1 Solution

Accepted Solutions
kuczynska
Contributor III

Re: Issue with a variable not working

Hi,

It could be an issue around using "=" in the variable definition window and using/not using the $ expansion in your expression window. Could you confirm how you are initiating the expression?

thanks,

Micha

2 Replies
kuczynska
Contributor III

Re: Issue with a variable not working

Hi,

It could be an issue around using "=" in the variable definition window and using/not using the $ expansion in your expression window. Could you confirm how you are initiating the expression?

thanks,

Micha

sofiavaz
Contributor

Re: Issue with a variable not working

Thank you Micha!

It was because of the "=" in the variable definition... I thought we should always use it but I was wrong...

Thank you very much for you help!

Sofia

Community Browser