Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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
Could you add an example (ie source data, expected result)?
Just 1 thing: set analysis is calculated once per chart (not once per row).
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
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.
Hi
Deepa PFA Document very useful for set analysis
Vikas
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