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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_saini
Master III
Master III

Exclude current month from YTD Expression

Hi Folks ,

I'm trying to neglect current month form the YTD expression , below is my expression :

My Month field here is "POPER_NEW"

if(sum({<Date={">=$(=YearStart(Date))<=$(=Max(Date))"},Year={2015},POPER_NEW=,Date=>}[Act Planned Production Hours]) = 0, avg({<Date={">=$(=YearStart(Date))<=$(=Max(Date))"},Year={2015},POPER_NEW=,Date=>}[Act OEE]),

sum({<Date={">=$(=YearStart(Date))<=$(=Max(Date))"},Year={2015},POPER_NEW=,Date=>}[Act OEE]*[Act Planned Production Hours])/sum({<Date={">=$(=YearStart(Date))<=$(=Max(Date))"},Year={2015},POPER_NEW=,Date=>}[Act Planned Production Hours]))

I tried something like below :

POPER_NEW={"(=max(POPER_NEW)-1)"}  , but its not working.

kindly help me here!'

Thanks,

AS

Labels (1)
10 Replies
Not applicable

HI

POPER_NEW-={"$(=Date(Monthstart(Today())),'DD.MMM.YYYY')"}

it will not properly mentioned always test it within text-box whether date is coming proper or not on which you gone perform action...

If you have POPER_NEW is in Date format then at script level create month field based on POPER_NEW

like ,

monthname(POPER_NEW) as POPER_NEW_Month,

POPER_NEW_Month-={"$(=Monthname(Today()))"}


Just try now...


regards