Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis problem

Dear All,

I am facing problem in seta analysis.

In variable vTest2 i am storring all the growth vendor name through concat.

vTest2=Concat(DISTINCT IF(AGGR(sum( {<@_Date={">=$(vFinStartDatePY)<=$(vMonthEndPY)"},@_FinFullYear=,@_FinQuarter=,@_Month=>} #_Sales_Qty)< sum( {<@_Date={">=$(vFinStartDateCY)<=$(vMonthEndCY)"},@_FinFullYear=,@_FinQuarter=,@_Month=>} #_Sales_Qty),CUSPARTYNAME),CUSPARTYNAME),',')

I have to write a expression for sum of the sale quantity for growth vendor.

Expression :-

=sum({$<@_Date={">=$(vFinStartDateCY)<=$(vMonthEndCY)"},@_FinFullYear=,@_FinQuarter=,@_Month=,CUSPARTYNAME={'$(vTest2)'}>} #_Sales_Qty)

-

sum({$<@_Date={">=$(vFinStartDatePY)<=$(vMonthEndPY)"},@_FinFullYear=,@_FinQuarter=,@_Month=,CUSPARTYNAME={'$(vTest2)'}>} #_Sales_Qty)

Means how much is the growth quantity from previous Year.

But its not working.

Please need your help.

Regards,

Sukamal

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Please find attached your solution.

View solution in original post

10 Replies
tresesco
MVP
MVP

I guess you are missing chr(39) in variable definition. Try to share your sample app.

Not applicable
Author

Its separated by  ','

Not applicable
Author

Its a live application I can't share it.

tresesco
MVP
MVP

It's fine about separator, but while you have to include strings in set analysis, multiple strings should be enclosed within single quotes and separated by commas. Isn't it so?

Not applicable
Author

I have given sing quote in set analysis.

CUSPARTYNAME={'$(vTest2)'}

But this is not working

tresesco
MVP
MVP


These quotes will evaluate your variable, but the the individual strings (that would be generated in the variable) would not have those quotes. Check your variable in a textbox. It would produce output like: String1, String2. While to use in set anaysis, that should have been like: 'String1', 'String2'.

Not applicable
Author

Hi Tresco,

I am attaching test .qvw and excel data.

Please check the app.

tresesco
MVP
MVP

Please find attached your solution.