Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
soniasweety
Valued Contributor III

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

Tags (2)
12 Replies
stabben23
Honored Contributor

Re: How it works?

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.

Re: How it works?

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
soniasweety
Valued Contributor III

Re: How it works?

yes I am getting null

but I want to get month end from that

stabben23
Honored Contributor

Re: How it works?

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

Re: How it works?

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'))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
MVP
MVP

Re: How it works?

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
Valued Contributor III

Re: How it works?

its giving me result like below

0.00012394 something

Re: How it works?

Never give like that

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
soniasweety
Valued Contributor III

Re: How it works?

I want to use this as variable

that value should be a  monthend