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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Using a variable in set analysis

I have this expression:

=SUM({$<[CleanMonth]={'2017/01'}, [ProdType]={'129'}>} Net_Revenue_Value)

This works perfectly. When I try to add in a variable in its place, I return no results.

SUM({$<[CleanMonth]={$(vNextSalesPeriod)}, [ProdType]={'129'}>} Net_Revenue_Value)

vNextSalesPeriod is a value from a database table which returns 2017/01 and shows correctly when I reference it in a text box. Do I need to wrap it in something else to get it to read in the variable?

Thank you.

1 Solution

Accepted Solutions
sunny_talwar

May be one of these

Sum({$<[CleanMonth]={'$(vNextSalesPeriod)'}, [ProdType]={'129'}>} Net_Revenue_Value)

Sum({$<[CleanMonth]={'$(=vNextSalesPeriod)'}, [ProdType]={'129'}>} Net_Revenue_Value)


Sum({$<[CleanMonth]={'$(=$(vNextSalesPeriod))'}, [ProdType]={'129'}>} Net_Revenue_Value)

View solution in original post

2 Replies
sunny_talwar

May be one of these

Sum({$<[CleanMonth]={'$(vNextSalesPeriod)'}, [ProdType]={'129'}>} Net_Revenue_Value)

Sum({$<[CleanMonth]={'$(=vNextSalesPeriod)'}, [ProdType]={'129'}>} Net_Revenue_Value)


Sum({$<[CleanMonth]={'$(=$(vNextSalesPeriod))'}, [ProdType]={'129'}>} Net_Revenue_Value)

shilpan
Partner Ambassador
Partner Ambassador

Agreed with Sunny; add single quotes around dollar-sign expansion for the month field