Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I want to create a timer that shows each month how much time is left until the 7th of the next month, probably using variables.
So for example if now() = 11/Jul/2023 11:00, until 7th of the next month (07/Aug/2023 00:00) I have 26 days and 13hours left = 637h and 0 minutes. I want this value to be presented in text or KPI object for example, and to be repetitive each month. So after 7th August, it will count down until 7th September. Basically, the range period is between 7th of the 2 months.
Thanks in advance for your help!
Try this as the expressin for the KPI:
Interval(
If(Day(Today(1)) <= 7,MakeDate(Year(AddMonths(Today(1),0)),Num(Month(AddMonths(Today(1),0))),7), MakeDate(Year(AddMonths(Today(1),1)),Num(Month(AddMonths(Today(1),1))),7))
-
Now(1)
,'D hh') & ' D hh'
Try this as the expressin for the KPI:
Interval(
If(Day(Today(1)) <= 7,MakeDate(Year(AddMonths(Today(1),0)),Num(Month(AddMonths(Today(1),0))),7), MakeDate(Year(AddMonths(Today(1),1)),Num(Month(AddMonths(Today(1),1))),7))
-
Now(1)
,'D hh') & ' D hh'
AddMonths(MonthStart(Now()),1) + 6 - Now() would get you the time left to the 7th of the next month.
If you want this to be the nearest 7th of a month (i.e. if today is the fifth, there are two days left), the easiest way is probably to add an if statement:
If(Day(Today() < 7, MakeDate(Year(Now(),Month(Now(),7) - Now(), AddMonths(MonthStart(Now()),1) + 6 - Now())
This formula gives me an error: Month takes 1 parametar
This works fine, thanks!