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

set analysis with variable

i have a problem with my expresion:

Sum({$<Year=,Month=,  Date={">=$(VStartDate1)<$(VEndDate1)"}>}Complain)

VStartDate1-->  =(AddYears(min(Date),-1))

VEndDate1--> =(AddYears(max(Date),-1))

why its not working (giving the wrong number)

maybe i need to take off the '='

tnx

1 Solution

Accepted Solutions
adiarnon
Creator III
Creator III
Author

i added a field of num(Date) and i entered it in the set analysis and it worked.

tnx evryone!!

View solution in original post

14 Replies
swuehl
MVP
MVP

What do you mean with 'wrong number', could you post a small sample application and your requested results?

In general, I would start with checking if the dollar sign expanded variables are expanded correct and in the required format (format of field Date). Paste your expression in a straight table (no dimension required), then hover over the expression label, you should see the expression with variables expanded.

adiarnon
Creator III
Creator III
Author

hi,

if  in the variable i put VStartDate1-->(AddYears(min(Date),-1)) without = before

and im adding a text box with =$(VStartDate1) i get 01/01/2014

and if in the variable i put VStartDate1-->=(AddYears(min(Date),-1)) with  = before

and im adding a text box with =$(VStartDate1) i get 0.088.....

witch i should choose and how can i put in the setanalysis?

swuehl
MVP
MVP

Try an equal sign before your variable definition, then enclose the variable expansion in single quotes:

Sum({$<Year=,Month=,  Date={">='$(VStartDate1)'<'$(VEndDate1)'"}>}Complain)


or instead, use the num() function in your variable definitions (also with equal sign before the expression):


=num(AddYears(min(Date),-1))

adiarnon
Creator III
Creator III
Author

its not working....

antoniotiman
Master III
Master III

Hi,

you add date() in the variables:

VStartDate1-->  =date(AddYears(min(Date),-1))

Regards

adiarnon
Creator III
Creator III
Author

this is th file,

sheet 7 with text box of the variables and the set analysis problem.

tnx

antoniotiman
Master III
Master III

I connot open the document. Denied access.

antoniotiman
Master III
Master III

You try to replace $ with 1

adiarnon
Creator III
Creator III
Author

can i do somthing to change it?