Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
=Sum({<OrderDate={">=$(=yearstart(addyears(max(OrderDate)),-1)<=$(=addyears(max(OrderDate)),-1))}>"}Sales)
this expression showing error[error in set modifier expression]
how to resolve it
You need something like this:
=Sum({< Year, OrderDate = {">=$(=date(yearstart(addyears(max(OrderDate),-1)), 'DD/MM/YYYY'))<=$(=date(addyears(max(OrderDate),-1), 'DD/MM/YYYY'))"}>} Sales)
whereby your trouble is caused from different formatting. Your OrderDate is 'DD/MM/YYYY' but your default format for dates within the application defined by the interpreting-variables at the script-start in tab Main is 'MM/DD/YYYY'.
IMO all dates and their interpretation within an application should have the same format und further I suggest to avoid all such trouble by using pure numeric values for each kind of matching and calculations. This means in your case just to double the OrderDate with an additionally floor(OrderDate) as OrderDateNum and then you could mostly use num() or floor() to call the comparing/calculation wherever you need it.
- Marcus
Try this:
=Sum({<OrderDate={">=$(=yearstart(addyears(max(OrderDate),-1))<=$(=addyears(max(OrderDate),-1))"}>}Sales)
thanks for replying
but still it is throwing error
The variables needs to be wrapped with single-quotes like:
=Sum({<OrderDate={">='$(=yearstart(addyears(max(OrderDate),-1))'
<='$(=addyears(max(OrderDate),-1))'"}>}Sales)
- Marcus
Hi @nagasekhar ,
Try this, ')' was missing:
=Sum({<OrderDate={">='$(=yearstart(addyears(max(OrderDate),-1)))'
<='$(=addyears(max(OrderDate),-1))'"}>}Sales)
Hai jyothish
I need to learn qlik sense administration
If you have any videos
Please send me
Mail: nag78936@gmail.com
Hai marcus_sommer
I need to learn qlik sense administration
If you have any videos
Please send me
Mail: nag78936@gmail.com
Hi @nagasekhar ,
I think the community what we have is the best place to learn also look out in youtube, there are lot of videos available 🙂
Also please close the thread by marking the correct answer if it helps 🙂
if i use simple set analysis i am getting (where 2010 is max date)
=sum({<Year={2009}>}Sales)
but while using ytd i am getting error
This bracket is missing: ... '$(=yearstart(addyears(max(OrderDate),-1)))' ...
- Marcus