Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

How it works?

Hi all,

how below expression works? can anyone explain?

Num(if(month(today())>=2,date('06/02/'&year(today()),'dd/mm/yyyy'),date('06/02/'&year(today())-1,'dd/mm/yyyy')))

Thanks

Sony

12 Replies
stabben23
Partner - Master
Partner - Master

Theoretical it will gives you a numeric value of a hardcoded date.

if this month if greater or Equal With february it gives you 06/02/2017, if not 06/02/2016.

Anil_Babu_Samineni

I believe this won't effect. It may show - because Month(Today()) always return String and String never resemblance with Number. 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
soniasweety
Master
Master
Author

yes I am getting null

but I want to get month end from that

stabben23
Partner - Master
Partner - Master

Where do you want it, in a textobject? and what do you want to see, explain the Logic.

Anil_Babu_Samineni

To clarify, This will work. But not really know for Which month you are going to have MonthEnd?

=if(Num(Month(today()))>=2,Date(MakeDate(year(today()), 02, 06),'DD/MM/YYYY'),Date(MakeDate(year(today())-1, 02, 06),'DD/MM/YYYY'))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tresesco
MVP
MVP

Date() here might not be required that way. Could you explain what exactly you are trying to do? May be explain in plain English. I guess much simpler solution would be there.

soniasweety
Master
Master
Author

its giving me result like below

0.00012394 something

Anil_Babu_Samineni

Never give like that

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
soniasweety
Master
Master
Author

I want to use this as variable

that value should be a  monthend