Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
asmithids
Partner - Creator II
Partner - Creator II

Variable in Set Analysis Not Working

Hello,

I created the following variable and used it in the set analysis expression.  The issue is that when I select a date in the Year-Month dimension, I am not getting any results as expected.  The expression is supposed to sum all payment amounts for all previous periods from the date selected in the Year-Month field.  The variable in the expression turns "active" when I remove the " "  but, the result is null.  When I include the " ", the variable turns to plain text and the result is 0.00.  I tested the results of the variable to the values in the Year-Month field and they match (i.e. 2018-Jun to 2018-Jun).  I know I'm close but don't see where I'm not correct.

Thank you in advance for any assistance!!

Variable: vYearMonth = GetFieldSelections([Year-Month])

Sum({$<Year=,Month=, [Year-Month]={"<$(vYearMonth)"}>}PaymentAmount)

1 Solution

Accepted Solutions
Zhandos_Shotan
Partner - Creator II
Partner - Creator II

Hi

Try to precalculate variable value using euation and test it:

Variable: vYearMonth = '=GetFieldSelections([Year-Month])'

Make sure that Year-Month dimension is Numeric so you can use it with "<"

View solution in original post

3 Replies
andrey_krylov
Specialist
Specialist

Hi Alec. I think only daytime or num formatted fields may be used for this purpose. So if [Year-Month] looks like 201801 it may be

Sum({$<Year=,Month=, [Year-Month]={"<$(=Min([Year-Month]))"}>}PaymentAmount)

Or if there is a date field

Sum({$<Year=,Month=, Date ={"<$(=Date(Min(Date)))"}>}PaymentAmount)

Zhandos_Shotan
Partner - Creator II
Partner - Creator II

Hi

Try to precalculate variable value using euation and test it:

Variable: vYearMonth = '=GetFieldSelections([Year-Month])'

Make sure that Year-Month dimension is Numeric so you can use it with "<"

asmithids
Partner - Creator II
Partner - Creator II
Author

Sorry for the late response. 

Thank you for the help!!