Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Set Analysis as variable into another set analysis

Hey Community,

i need your help with a set analysis problem. I have defined variables by using set analysis. If I put them into a textbox I get the right result.

Here two examples:

vStart_PriorYear

=if (vOhneAuswahl = 0,  date(AddYears(YearStart(Min({<%Artikelnr=,%Statistikklasse=,%KreditorNr=>} today())),-1)),

     IF(MonthStart(Min({<%Artikelnr=,%Statistikklasse=,%KreditorNr=>} %Datum))> today(),

          0,

               date(AddYears(MonthStart(Min({<%Artikelnr=,%Statistikklasse=,%KreditorNr=>}%Datum)),-1))))

vEnd_PriorYear

=IF(MonthStart(Min({<%Artikelnr=,%Statistikklasse=,%KreditorNr=>} %Datum))> today(),

     0,

          If(MonthEnd(Max({<%Artikelnr=,%Statistikklasse=,%KreditorNr=>} %Datum))<today(),

               date(AddYears(MonthEnd(Max({<%Artikelnr=,%Statistikklasse=,%KreditorNr=>}%Datum)),-1)),

                    date(AddYears(today(),-1))))


Now I would like to use those variables in another set analysis. And that is my PROBLEM. I cannot make it work!!!

Here is the set analysis that is not working.

= Sum({<%Datum={'>=$(vStart_PriorYear)<=$(vEnd_PriorYear)'}>} [Sales])

Thanks a lot!

Martin

1 Solution

Accepted Solutions
Not applicable

Re: Set Analysis as variable into another set analysis

I have solved the problem myself.

I forget to exclude the selection in my calendar.

My working set analysis looks now like that.

= Sum({<Calendar.Jahr=, Calendar.Quartal=, Calendar.Monat=, Calendar.EindeutigerMonat=, %Datum={'>=$(vStart_PriorYear)<=$(vEnd_PriorYear)'}>} [Sales])

Thanks anyways for your quick response

2 Replies
MVP & Luminary
MVP & Luminary

Re: Set Analysis as variable into another set analysis

Could be something to do with the date format of the values in your variables. Can you post a document that demonstrates the problem?


talk is cheap, supply exceeds demand
Not applicable

Re: Set Analysis as variable into another set analysis

I have solved the problem myself.

I forget to exclude the selection in my calendar.

My working set analysis looks now like that.

= Sum({<Calendar.Jahr=, Calendar.Quartal=, Calendar.Monat=, Calendar.EindeutigerMonat=, %Datum={'>=$(vStart_PriorYear)<=$(vEnd_PriorYear)'}>} [Sales])

Thanks anyways for your quick response