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

ongoing month

Hello experts

I need your help. I need the current month and the ongoing month of a selected year. Example: Today is 05/08/2021

Current formula only gives May. I need May until December of 2021:

Month(today([Delivery Date] + [Days]))

Any ideas?

Many thanks

tom

1 Solution

Accepted Solutions
OmarBenSalem

what do u mean by this???? " [Delivery Date] + [Days] " a condition is applied to ONE DIMENSION !

View solution in original post

7 Replies
Vegar
MVP
MVP

You can get the end of year using yearend()

Try using  YearEnd(today()) or if you need the date dayname(YearEnd(today()) )

OmarBenSalem

It would be sthing like :

sum({<MonthField, DateField ={>="$(=max(DateField))<=$(=yearEnd(max(DateField)))"}>}YourMeasure)

 

if u for example, select 5/8/2021, it would return,

sum(date betwwen 5/5/2021 and 31/12/2021)

if u select month Mars for example, the max date would become 31/3/2021 and thus expression would return the data between 31/3/2021 and 31/12/2021

 

Please take a look a this for a better explanation :

https://community.qlik.com/t5/New-to-Qlik-Sense/YTD-MTD-issue/td-p/1278297

TomBond77
Creator III
Creator III
Author

Thank you Omar

I am getting this error. The end year 2023 is not too bad, but the starting value is incorrect. Any ideas?

PO.PNG

MayilVahanan

Hi @TomBond77 

Need to include date() function in set analysis

=sum({<MonthField, DateField ={>="$(=Date(max(DateField),'DD.MM.YYYY'))<=$(=yearEnd(max(DateField)))"}>}YourMeasure)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
TomBond77
Creator III
Creator III
Author

Hi Mayil

This formula is not working, no expression error but is not showing any result:

sum({<Month, [Delivery Date] + [Days] ={>=$(=Date(max([Delivery Date] + [Days], 'DD.MM.YYYY')
<=$(yearEnd(max([Delivery Date] + [Days])))}>} [Net Value])

Any ideas?

A dimension master item shows correctly the month in a table:  =Month([Delivery Date] + [Days])

OmarBenSalem

what do u mean by this???? " [Delivery Date] + [Days] " a condition is applied to ONE DIMENSION !

TomBond77
Creator III
Creator III
Author

this expression give the correct month: 

=Month([Delivery Date] + [Days])   

Delivery Date is a date field. Days is a number, e.g. 15.

Now the following formula should become to work :   sum({<Month, [Delivery Date] + [Days] ={>=$(=Date(max([Delivery Date] + [Days], 'DD.MM.YYYY')
<=$(yearEnd(max([Delivery Date] + [Days])))}>} [Net Value])