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

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

Set analysis

Hi all,

I have created a table, and the results is

FirstOrderCalendar.Month Name count(order) =monthname(AddMonths([FirstOrderCalendar.Month Name], 1))
0
Jan 20130Feb 2013
Feb 20130Mar 2013
Mar 20130Apr 2013
Apr 20130May 2013
May 20130Jun 2013
Jun 20130Jul 2013
Jul 20130Aug 2013
Aug 20130Sep 2013
Sep 20130Oct 2013
Oct 20130Nov 2013
Nov 20130Dec 2013
Dec 20130Jan 2014

If i select on the table FirstOrderCalendar "Feb 2013", it's working, I have my count of orders

FirstOrderCalendar.Month Name count(order) =monthname(AddMonths([FirstOrderCalendar.Month Name], 1))
16450 Mar 2013
Feb 201316450Mar 2013

What's wrong with my set analysis ?

Why when I unselect Feb 2013 I have only 0 orders

=> Set analysis :

count({$<[SalesCalendar.Month Name]={'$(=only(DISTINCT monthname(AddMonths([FirstOrderCalendar.Month Name], 1))))'}>} [Order ID])

1 Solution

Accepted Solutions
jerem1234
Specialist II
Specialist II

You're better off using an if statement here, such as:

count(if([SalesCalendar.Month Name]=monthname(AddMonths([FirstOrderCalendar.Month Name], 1)), [Order ID]))

Hope this helps!

View solution in original post

8 Replies
javier_florian
Creator III
Creator III

Hi Adrien,

Did you tried with:

count({$<[SalesCalendar.Month Name]={'$(=only(DISTINCT [FirstOrderCalendar.Month Name]'}>} [Order ID])

Not applicable
Author

Yes I tried and still have 0...

Not applicable
Author

hi Adiren

and with a little = sign just before $

Chris

Not applicable
Author

Thanks for your answers, but I don't think it's a problem of = because it's working when I select one month (Table 2) - I think it's a problem when I have more than one month, set analysis doesn't work!

Not applicable
Author

Any ideas ? 😕

Anonymous
Not applicable
Author

As you are using "only" in the set analysis which means the expression will be evaluated only if one value of that field is selected.

jerem1234
Specialist II
Specialist II

You're better off using an if statement here, such as:

count(if([SalesCalendar.Month Name]=monthname(AddMonths([FirstOrderCalendar.Month Name], 1)), [Order ID]))

Hope this helps!

Not applicable
Author

yeah it's working !

thanks