Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
danielact
Partner - Creator III
Partner - Creator III

Why isn't my set analysis working?

I have a field called DataTime, which shows what quarter the data is from. It has values such as 2013Q1, 2012Q4, 2012Q3, etc.

I created another island table off of it called %Quarters, which just lists the quarters. This is so the users can do a comparison of any two quarters. For the most part, they'll always be looking at one quarter of data, so for DataTime, there must always be a selected value. If I have 2013Q4 selected in DataTime, and 2012Q4 selected in %Quarters, I want to see both quarters data, and the difference.

I used the following to see the data for 2012Q4:

Sum({$<DataTime={"=DataTime=%Quarters"}>} Premium)

but for some reason, it's only coming up with numbers when I have DataTime and %Quarters set to the same value. Shouldn't the set analysis ignore my selection in DataTime? Why isn't this working?

Labels (1)
2 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Probably you want to:

Sum({$<DataTime=, %Quarters=>} Premium)

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

DataTime and %Quarters are two fields with no association between them. Remember that the set expression is evaluated once for the object and has no knowledge of the dimensions in a chart or table. What you are asking it is to compare DataTime a list of values. This is not a legal operation so it returns null.

When you select something on %Quarters, then DataTime is being compared to a value and your expression works.

Assuming that %Quarters is a dimension in a chart, you would need to use sum(if()) to compare them.

     Sum(If(DataTime = %Quarters, Premium)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein