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: 
tabletuner
Creator III
Creator III

Help needed: Set Analysis experts

Hi all,

My business problem is as follows:

I am trying to compare sales figures for 2 periods:

1 ) week 2009-53 till week 2009-02

2) week 2009-01 till week 2008-02

My application has a record called weeknumber (YYYYWW mask) in the sales table. To get the sales for period 2 i select the weeknumbers in a list box and I use set analysis in the chart in the following way:

=

sum( {$<[SalesTable.Weeknumber] = {$(vYTDSelectedWeeknumbers)}>} [SalesTable.SalesAmount])

The variable vYTDSelectedWeeknumbers is defined as follows:



=

Concat(DISTINCT weekyear(makeweekdate(left(SalesTable.Weeknumber,4),right(SalesTable.Weeknumber,2),6)-364) & num(week(makeweekdate(left(SalesTable.Weeknumber,4),right(SalesTable.Weeknumber,2),6)-364),'00'),',')

The variable results in a string of distinct weeknumbers that lie 52 weeks in the past. Separator is a comma because set analysis expects also this separator (in case of multiple elements).





If my user selects for instance 52 weeknumbers then the set analysis receives 52 input elements. And if the user deletes all selections, the whole program takes ages to load (its better to shut down to continue...). In the manual i read it should be avoided to put more then a few hundred elements in a set analysis. However, my set analysis in this example receives 200 elements at max.

Could anyone give me advice on this set analysis problem? Maybe i've chosen the wrong solution for this business problem. If so please give me advice!

Regards,

Tjeerd



1 Solution

Accepted Solutions
tabletuner
Creator III
Creator III
Author

I solved the problem by using some extra tables in which in stored the distincted values of weeknumber.

I was amazed by noticing that set analysis seems to work with no problem when using over 1000 values!

View solution in original post

1 Reply
tabletuner
Creator III
Creator III
Author

I solved the problem by using some extra tables in which in stored the distincted values of weeknumber.

I was amazed by noticing that set analysis seems to work with no problem when using over 1000 values!