Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Live Chat, June 29th 10AM ET. Bring your Qik Sense Enterprise, Client Managed questions! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
TomBond77
Creator II
Creator II

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
Partner
Partner

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

View solution in original post

7 Replies
Vegar
Partner
Partner

You can get the end of year using yearend()

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

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
OmarBenSalem
Partner
Partner

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 II
Creator II
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
TomBond77
Creator II
Creator II
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
Partner
Partner

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

View solution in original post

TomBond77
Creator II
Creator II
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])