Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
deepali_more
Creator
Creator

Set Analysis

Hi all i am beginner to Qlikview development and i have a question: How can we make set analysis dynamic? if i want to show data for previous 5 years for particular dates from different months..assuming sales to be measure ..then how will that expression will be like?

1 Solution

Accepted Solutions
marcus_sommer

You could use as many fields you need within the set analysis to dertermine which data should be considered for those calculations and each of them could be a calculation which returned a dataset based on the current selections or ignore parts of them. Quite often are the set analysis function p() and e() very useful for such a doing.

In your case I would use - maybe additionally - fields (created within a master calendar) like DayInYear or DateWithoutYear and then:

sum({< Year = {">=max(Year) - 5"}, p(DateWithoutYear) >} value)

- Marcus

View solution in original post

6 Replies
maxgro
MVP
MVP

Could you add an example (ie source data, expected result)?

Just 1 thing: set analysis is calculated once per chart (not once per row).

marcus_sommer

You could use calculations within the set analysis like:

sum({< Year = {">=max(Year) - 5"}>} value)

See here for various examples on set analysis: Set Analysis: syntaxes, examples

- Marcus

deepali_more
Creator
Creator
Author

Hi Marcus,

It is useful answer but i want to say..what if i want to have data for year 2010 to 2015 , for months = March,May,Nov, Dec and for dates

For March = 1 to 15

For May= 14 to 20

For Nov = 15 to 30

and for Dec = 1 to 30

how can we achieve this? it won'tbe good idea to give all these condition in modifier..right?

please correct me if i am wrong.

vikasmahajan

Hi

Deepa PFA Document very useful for set analysis

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
marcus_sommer

You could use as many fields you need within the set analysis to dertermine which data should be considered for those calculations and each of them could be a calculation which returned a dataset based on the current selections or ignore parts of them. Quite often are the set analysis function p() and e() very useful for such a doing.

In your case I would use - maybe additionally - fields (created within a master calendar) like DayInYear or DateWithoutYear and then:

sum({< Year = {">=max(Year) - 5"}, p(DateWithoutYear) >} value)

- Marcus