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: 
Not applicable

Set analysis pb

Hi guys,

MAy I have your help for a simple problem  I don't understand it doesn't work.

I want to use Set analysis to dosplay the value of N-1 starting for a selected date (from an island table)

Sales for year is  sum(Sales)

Sales for previous year should be . sum({$<SalesYear = {$(=Only(Cal_An)-1)}>} Sales)

Cal_An is the year which result from a Cal_Date selection (01/05/2012)  and gives only 1 value (2012) and it is stored in an island table detached from other tables.

Nevertheless I 've the same prblem with YTD

I would appreciate an precious help

Thanks

Chris

1 Solution

Accepted Solutions
Not applicable
Author

Hi guys,

Thnak you to everybody for having participate to solve this problem.

I finally found the right syntax

sum( {<SalesYear= {'$(=only(Cal_An))'} >} SalesUN)

Means I get all the sales YTD from january to last known month

Best regards

Christian

Selon Michael Solomovich <qliktech@sgaur.hosted.jivesoftware.com>:

Michael Solomovich created

the discussion

"Re: Set analysis pb"

To view the discussion, visit:

http://community.qlik.com/message/235515#235515

View solution in original post

11 Replies
Not applicable
Author

Try inserting $(=Only(Cal_An)-1) between ' '.

if it does not work, put each part in a text field and see the results. that will help find the problem.

Anonymous
Not applicable
Author

I use double quotes in similar situations::

sum({$<SalesYear = {"$(=Only(Cal_An)-1)"}>} Sales)

Not applicable
Author

Hi Michael

Thank you for your answer. I am trying it

Nice to hear from you again.

What are youi doing now ?

christian

Selon Michael Solomovich <qliktech@sgaur.hosted.jivesoftware.com>:

Michael Solomovich created

the discussion

"Re: Set analysis pb"

To view the discussion, visit:

http://community.qlik.com/message/235103#235103

Not applicable
Author

Sorry this doesn't work neither

Selon Michael Solomovich <qliktech@sgaur.hosted.jivesoftware.com>:

Michael Solomovich created

the discussion

"Re: Set analysis pb"

To view the discussion, visit:

http://community.qlik.com/message/235103#235103

swuehl
MVP
MVP

What if you input a literal as year, like

=sum({$<SalesYear = {2011}>} Sales)

does this gives you a correct result?

=Only(Cal_An)-1

in a text box returns 2011?

Not applicable
Author

Thank you for answering but doesn't work either

Christian

Selon swuehl <qliktech@sgaur.hosted.jivesoftware.com>:

swuehl created the discussion

"Re: Set analysis pb"

To view the discussion, visit:

http://community.qlik.com/message/235149#235149

swuehl
MVP
MVP

What hasn't worked? The sum or the only? Or both?

If the sum hasn't worked and your SalesYear are really numericals like 2011, I assume you need to clear selections in other fields that are incompatible with your selection in SalesYear (e.g. do you have also selections in SalesDate or SalesMonth? Then you need to clear these fields:

=sum({$<SalesYear = {2011}, SalesDate=, SalesMonth= >} Sales)

Not applicable
Author

Could you upload the file?

That would be easier to check.

Anonymous
Not applicable
Author

Hi Christian,

I'm fine, thanks for asking. 

As for the problem, I hope Stefen's answer is helpful.  Still not clear if the textbox =Only(Cal_An)-1 works or not.  If you can't figure out, you better upload the application.

Best Regards,

Michael