Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Smeenakshi23
Creator II
Creator II

Qlikview Date condition

I need to create a variable for the below condition in Qlikview. Could you please help.

If the day of the current date is < 10, then report starts on the 15th day of the current month, else the report starts on 1st day of the next month. (For example, if the report runs on 01NOV2017, the beginning start usage date = 15NOV2017. If the report runs on 15NOV2017, the beginning start usage date = 01DEC2017) . I have start usage date filed in my report.

I have to use the above condition in Npriting. so thinking to create a variable in Qlikview

1 Solution

Accepted Solutions
sunny_talwar

May be this

vVar

Date(If(Day(Today()) < 10, MonthStart(Today()) + 14, MonthStart(Today(), 1)))

UPDATE: Fixed my expression based on the comment below

View solution in original post

5 Replies
sunny_talwar

May be this

vVar

Date(If(Day(Today()) < 10, MonthStart(Today()) + 14, MonthStart(Today(), 1)))

UPDATE: Fixed my expression based on the comment below

mdmukramali
Specialist III
Specialist III

Dear,

can you try like

=Date(If(Day(Today() )< 10, MonthStart(Today()) + 14, MonthStart(Today(), 1)))

you should check the data format of the start usage date filed and variable date format.

sunny_talwar

I updated my expression based on yours just so we don't have an incomplete and incorrect expression... but if this works, I would suggest the OP to mark your response as the correct one

Smeenakshi23
Creator II
Creator II
Author

Thanks a lot Sunny,

It works great.

Smeenakshi23
Creator II
Creator II
Author

Dear Sunny,

one more doubt here,  As start usage date i have some condition for end usage date.  I need to select all the dates between start and end usage date. Will the above condition does that .

End usage date condition will be the kind  of start usage date.

As mentioned above i need to select the date values between start and end usage date.

For ex :  if the start dte is 15/11/2017 and end date is 30/11/2017,  the dates between these two dates should be selected.