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

date function problem

if([Req2 Date]<[Run2 Date], MonthStart([Run2 Date],0)

why it is giving blank spaces when i use it as straight table expression

Qlikss Sugessttttt

1 Solution

Accepted Solutions
sunny_talwar

Or this:

Date(If([Req2 Date]<[Run2 Date], MonthStart([Run2 Date]),0)


Or you can set the format on the numbers tab to show as Date

View solution in original post

14 Replies
sunny_talwar

Are there more than one Req2 Date or Run2 Date for each dimension value? If that's the case, you will need to use some sort of Aggregation to know which of the multiple dates to use (like Min or Max)

srikantj
Creator
Creator
Author

hi sunny

req2 date run2 date ---- dimensions

if([Req2 Date]<[Run2 Date], MonthStart([Run2 Date],0) -- Expression

What i have to do

srikantj
Creator
Creator
Author

and i have 6000 rows for each date field

sunny_talwar

If those are dimension, then we don't have to worry about aggregations. Next thing to check is to see if Req2 Date and Run2 Date are read as date by qlikview or not. If they are strings, then the if statement will not work and so will Monthstart

Why don’t my dates work?

QlikView Date fields

Get the Dates Right

srikantj
Creator
Creator
Author

if([Req2 Date]<[Run2 Date],1,0)

it is working fine for this expression

but when i add monthstart fucnction it is not working

sunny_talwar

Can you share a screenshot of the two expressions

1) if([Req2 Date]<[Run2 Date], MonthStart([Run2 Date],0)

2) if([Req2 Date]<[Run2 Date],1,0)

srikantj
Creator
Creator
Author

dates.PNG

sunny_talwar

Oh you have a missing parenthesis, try this

if([Req2 Date]<[Run2 Date], MonthStart([Run2 Date]),0)

srikantj
Creator
Creator
Author

But it is coming in number format .. why it is not coming date formatdates.PNG