Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
arethaking
Creator II
Creator II

Set Analysis expression

Hi All,

I have the monthly data for the whole year. But I want to show the data until September.

How to write the set analysis expression.

Thanks in advance.

Data:

   

AmountProductYearMonth Name
2P22016Feb
2P42015Sep
2P32015Jun
2P12016Feb
2P42015Mar
2P12016Feb
5P32015Jun
6P32015Jan
6P32015Feb
6P32015Mar
6P32015Apr
6P32015May
6P32015Jul
6P32015Aug
6P32016Mar
6P32016Apr
6P42016Jul
7P32015Jan
7P32015Feb
7P32015Mar
7P32015Apr
7P32015May
7P32015Jun
7P32015Jul
7P32015Aug
7P32015Sep
7P32015Oct
7P32015Nov
7P32015Dec
7P32016Jan
7P32016Feb
7P32016Mar
7P32016Apr
7P32016May
7P32016Jun
7P32016Jul
7P32016Aug
7P32016Sep
7P32016Oct
7P32016Nov
7P32016Dec
7P42015Jan
7P42015Feb
7P42015Mar
7P42015Apr
7P42015May
7P42015Jun
7P42015Jul
7P42015Aug
7P42015Sep
7P42015Oct
7P42015Nov
7P42015Dec
7P42016Jan
7P42016Feb
7P42016Mar
7P42016Apr
7P42016May
7P42016Jun
7P42016Jul
7P42016Aug
7P42016Sep
7P42016Oct
7P42016Nov
7P42016Dec
8P42015Nov
8P42015Dec
10P12015Jan
10P12015Feb
10P12015Apr
10P12016Jan
10P12016Feb
10P12016Mar
10P12016Apr
10P12016May
10P12016Jun
10P12016Jul
10P12016Aug
10P12016Sep
10P12016Oct
10P12016Nov
10P12016Dec
11P12015Jan
11P12015Feb
11P12015Mar
11P12015Apr
11P12015May
11P12015Jun
11P12015Jul
11P12015Aug
11P12015Sep
11P12015Oct
11P12015Nov
11P12015Dec
11P12016Jan
11P12016Feb
16P22015Jul
17P22015May
17P22015Jun
18P22015Apr
18P22015Aug
18P22015Sep
19P22015Jan
19P22015Feb
19P22015Mar
19P22015Apr
19P22015May
19P22015Jun
19P22015Oct
19P22015Nov
19P22015Dec
19P22016Jan
19P22016Feb
19P22016Mar
19P22016Apr
19P22016May
19P22016Jun
20P22015Jan
20P22015Feb
20P22015Jul
20P22015Aug
20P22015Sep
20P22015Oct
20P22015Nov
20P22015Dec
20P22016Jan
20P22016Feb
20P22016Mar
20P22016Apr
20P22016May
20P22016Jun
20P22016Jul
20P22016Aug
20P22016Sep
20P22016Oct
20P22016Nov
20P22016Dec
21P22016Sep
21P22016Oct
21P22016Nov
92.830879456P22015Dec
123.562104384P42016Feb
171.46285083P22016Apr
207.918426888P42016Jul
213.38207968P22015Jan
255.199400592P42016May
261.973532776P42015Sep
330.84459726P22016May
369.907257888P22015Sep
370.631483462P42015Dec
390.766210104P42016Feb
407.0324552P22015Jan
418.684886046P22016Jul
422.546273856P22015Apr
433.258467264P22015Mar
450.973911584P22015Jun
460.07688168P22016Jan
472.180412256P22015May
487.236387228P42015Sep
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Select Year 2016 and then use the following expression:

Sum({<MonthName={'<=$(=Date(MonthEnd(Today(),-1)))'}>}Amount)

For selection independent YTD, you can try:

Sum({<MonthName={'>=$(=Date(YearStart(Today())))<=$(=Date(MonthEnd(Today(),-1)))'}>}Amount)

And yes, a generic suggestion, use Year() to create Year field in the script instead of Date#().

View solution in original post

3 Replies
tresesco
MVP
MVP

Select Year 2016 and then use the following expression:

Sum({<MonthName={'<=$(=Date(MonthEnd(Today(),-1)))'}>}Amount)

For selection independent YTD, you can try:

Sum({<MonthName={'>=$(=Date(YearStart(Today())))<=$(=Date(MonthEnd(Today(),-1)))'}>}Amount)

And yes, a generic suggestion, use Year() to create Year field in the script instead of Date#().

amir_taub
Partner - Contributor II
Partner - Contributor II

Hi King

if you need some more help ,there is a wizard for SET go to :

Set Analysis Wizard for QlikView | qlikblog.at

Also,  you need to:

1. create a Date Field,

=date(MakeDate(year,month),'DD/MM/YYYY') ---- 01/02/2016

2. Make a VAR 

vDatePast ----  =date(MakeDate(year,month),'DD/MM/YYYY')

3. Do a set ----  Date Field={"<$(vDatePast)"}

good luck

Amir Taub

Anonymous
Not applicable

Hi Aretha,

See the document on this post

https://community.qlik.com/docs/DOC-4249

Regards!