Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

set Expression

sum( {$<[TO_YEAR] = {2014},[TO_MONTH]={'JAN'}>} [PREMIUM] )

The above expression is not working properly Can some one let me know whether any thing is incorrect with this expression

1 Solution

Accepted Solutions
Not applicable

Please, be more explicit. What does it mean "not properly" ?

Check the fields (low case, upper case) that they are written correctly. QV is case sensitive.

Fabrice

View solution in original post

7 Replies
Not applicable

Please, be more explicit. What does it mean "not properly" ?

Check the fields (low case, upper case) that they are written correctly. QV is case sensitive.

Fabrice

luis_pimentel
Partner - Creator III
Partner - Creator III

Did you try '2014' with single quotes, like:

sum( {$<[TO_YEAR] = {'2014'},[TO_MONTH]={'JAN'}>} [PREMIUM] )

upaliwije
Creator II
Creator II
Author

Although I select Year as 2014 results shown are for the year 2015

Not applicable

TO_YEAR and TO_MONTH are two dimensions?

upaliwije
Creator II
Creator II
Author

Yea two dimensions

atsushi_saijo
Creator II
Creator II

I also have struggled in Dates. Even 'January' connotates 'January of 2013' if we handle it only with DATE([datefield],'MMM'). In my cautious loading script, I have created in such tools so that we would be ready for using any date range:

DATEFIELD AS H.DT.O,
IF(DATEFIELD>0,DATE(DATE#(DATEFIELD,'YYYYMMDD'),'(WWW) DDMMMYYYY')) AS H.DT,
IF(DATEFIELD>0,'W'&WEEK(DATE#(DATEFIELD,'YYYYMMDD'))) AS H.DT.W,
IF(DATEFIELD>0,'Q'&CEIL(MONTH(DATE#(DATEFIELD,'YYYYMMDD'))/3)) AS H.DT.Q,
IF(DATEFIELD>0,MONTHEND(DATE#(DATEFIELD,'YYYYMMDD'),0)) AS H.ME,
IF(DATEFIELD>0,MONTH(DATE#(DATEFIELD,'YYYYMMDD'))) AS H.MT,
IF(DATEFIELD>0,YEAR(DATE#(DATEFIELD,'YYYYMMDD'))) AS H.YR,

In such case, January means January of 1984......2014. Q1 means .... and so forth.

Please advise if this works for you.

Anonymous
Not applicable

The expression looks fine by itself.  Can you upload a sample of your application?