Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
alknirmal1
Partner - Contributor III
Partner - Contributor III

Need help to resolve the set analysis issue

Hi All,

I have a variable declared in the variable overview tab.

varQuarter1 = $(varReportYear)&'-Q1'

where varReportYear is another variable which is set based on a selection from the list box.


I need to use the variable varQuarter1  inside a set analysis expression..


Expression :    Sum(Total {<DateYearQuarter={"$(=varQuarter1)"}>}AdjNOI)


This expression in set analysis is not giving the correct result.. When I hard code a value for varQuarter1 ,its gives me correct result.


Sum(Total {<DateYearQuarter={'2014-Q1'}>}AdjNOI)  -- This works fine.


I checked the variables varReportYear,varQuarter1  and both are returning correct values.


Can anyone please help me how to use this variable correctly in setanalysis .


Thanks

Nirmal.

1 Solution

Accepted Solutions
Colin-Albert

Try

Sum(Total {<DateYearQuarter={'$(varQuarter1)'}>}AdjNOI)


Your variable is text not an integer,so needs to be enclosed in single quotes to be interpreted correctly.

View solution in original post

10 Replies
reshmakala
Creator III
Creator III

Can you try if this works?

Sum(Total {<DateYearQuarter={$(varQuarter1)}>}AdjNOI)

alknirmal1
Partner - Contributor III
Partner - Contributor III
Author

Thanks for your quick reply.

Unfortunately its not working .

alknirmal1
Partner - Contributor III
Partner - Contributor III
Author

it give the below error.

Error: Error in set modifier ad hoc element list:

',' or ')' expected

reshmakala
Creator III
Creator III

Could you attach a sample QVW?

Just create those two variables and the expression that you have tried so that I can understand where exactly the pblm is

Colin-Albert

Try

Sum(Total {<DateYearQuarter={'$(varQuarter1)'}>}AdjNOI)


Your variable is text not an integer,so needs to be enclosed in single quotes to be interpreted correctly.

alknirmal1
Partner - Contributor III
Partner - Contributor III
Author

Thanks for your reply Colin..

It doesn't work 

Colin-Albert

Add a text box with. =$(varQuarter1) as the expression, and add a listbox on the DateYearQuarter field.

This should show any differences in the field data and variable data.

reshmakala
Creator III
Creator III

Can you try this?

=Sum({<DateYearQuarter={$('varQuarter1')}>}AdjNOI)

I guess this should work.

maxgro
MVP
MVP

or make a str table with your expression and with an empty label

hover the mouse on the label and watch your expression in the popup