Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Expression

Hi,

My following expression is not working.

SUM({<PAID_Month_Year={"<=Jul-2016"}>}PREMIUM)

Pls advise me where I am wrong

9 Replies
avinashelite

Did you check the format of PAID_Month_Year? is MMM-YYYY

tresesco
MVP
MVP

It could be your PAID_Month_Year field format. How did you create the field in the script? If you use string functions to create it, set would not be to compare it like <=/ >= the way you want. You have to possible create a dual field in the script to use it in the set expression like you want.

upaliwije
Creator II
Creator II
Author

yes

It is like this

 

Jan-2016
Jul-2013
Jul-2014
Jul-2015
Jul-2016
Jun-2013
upaliwije
Creator II
Creator II
Author

my script is as blow

Month(PAID_DATE) &'-'& YEAR(PAID_DATE) As PAID_Month_Year,

Chanty4u
MVP
MVP

try this

MakeDate(year(PAID_DATE),month(PAID_DATE)) as Paid_Month_Year

tresesco
MVP
MVP

Try it like:

Load

          Dual(PAID_Month_Year, MakeDate(Year(PAID_DATE), Month(PAID_DATE))) as PAID_Month_Year ;

Load         

          Month(PAID_DATE) &'-'& YEAR(PAID_DATE) As PAID_Month_Year,

              ..

tresesco
MVP
MVP

Also, be careful when writing the set expression. You have to mention the the default date format like:

SUM({<PAID_Month_Year={"<=$(=Date(Date#('Jul-2016','MMM-YYYY'),'DD/MM/YYYY'))"}>}PREMIUM)


Note: the highlighted format might be different for your case.


Please also refer the attached qvw for better understanding.



Anil_Babu_Samineni

Still not Resolved please post sample?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
teiswamsler
Partner - Creator III
Partner - Creator III

Hi Upali

Consider using numeric date formats in expression when >=<

ex.

YYYYMM or YYYYMMDD

/Teis