Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use expression in set analysis

In a Text Box I have this expression that gives me (what i believe to be) the numeric value for the previous month

=num(month(min(flow_date)-1)))

If I hard code the {2} the straight table shows the avg value...

=(Sum( {$<flow_month={2}, flow_day={">=1<=31"}>} numeric_value_1) - Sum( {$<flow_month={2}, flow_day={">=1<=31"}>} numeric_value_2)) / count({$<flow_month={2}, flow_day={">=1<=31"}>} flow_date)

so... can how would I replace the {2} with the expression from the text box?

thanks,

James

1 Solution

Accepted Solutions
jykang0638
Partner - Contributor III
Partner - Contributor III

Hi James,

You can use $ sign expansion syntax at the set analysis like this:
Sum( {$<flow_month={"$(=month(min(flow_date)-1))"}, flow_day={">=1<=31"}>} numeric_value_1)

I hope it will help you.

Steve Kang

View solution in original post

2 Replies
jykang0638
Partner - Contributor III
Partner - Contributor III

Hi James,

You can use $ sign expansion syntax at the set analysis like this:
Sum( {$<flow_month={"$(=month(min(flow_date)-1))"}, flow_day={">=1<=31"}>} numeric_value_1)

I hope it will help you.

Steve Kang

Not applicable
Author

Steve,

Thanks.  I tried many variations, but yours led to the correct answer.

Note:  I added the num() back into the expression.  Something about my flow_month is a numeric value which did not match the result of month()

James