Skip to main content
Announcements
[WEBINAR] Accenture & Qlik: Accelerating BI Migration to SaaS with Qlik on Dec 13th: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
martin_hamilton
Creator
Creator

Variable within a set expression not working

Hi - I previously posted and gained an answer for only selecting certain values within a straight table. https://community.qlik.com/t5/New-to-QlikView/Only-include-certain-values-in-straight-table/m-p/8267...

I now have a requirement to select based on a variable being included in the set expression.

If i set the expression like the following it works:

=only({<CONNECTED_MONTH={'Nov 2018'}>}CONNECTED_MONTH)

But when I set it like the below it doesnt:

=only({<CONNECTED_MONTH={"=vCurrentMonth"}>}CONNECTED_MONTH)

=only({<CONNECTED_MONTH={"vCurrentMonth"}>}CONNECTED_MONTH)

=only({<CONNECTED_MONTH={vCurrentMonth}>}CONNECTED_MONTH)

The variable is working fine and is the following:

vCurrentMonth is  =MonthName(Today(1))

What am I doing wrong. the field in question it is validating has been derived and shows Nov 2018

 

Any ideas welcome thank you in advance.

 

Martin

Labels (1)
1 Solution

Accepted Solutions
phillipmacd
Contributor III
Contributor III

hi, maybe try and analyze the value of the variable,

only({<CONNECTED_MONTH={'$(vCurrentMonth)'}>}CONNECTED_MONTH)

View solution in original post

3 Replies
phillipmacd
Contributor III
Contributor III

hi, maybe try and analyze the value of the variable,

only({<CONNECTED_MONTH={'$(vCurrentMonth)'}>}CONNECTED_MONTH)

sunny_talwar

Or one of these

=Only({<CONNECTED_MONTH ={"$(=vCurrentMonth)"}>} CONNECTED_MONTH)
=Only({<CONNECTED_MONTH ={"$(=$(vCurrentMonth))"}>} CONNECTED_MONTH)
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Try:

=only({<CONNECTED_MONTH={"$(vCurrentMonth)"}>}CONNECTED_MONTH)

 

Technically it should be single quotes, but there is a bug in QV 12.20 that requires double quotes when the modifier field is a dual. 

 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com