Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Pulkit_Thukral
Partner - Creator II
Partner - Creator II

p funtion with date range

Hi All,

How can we use a date range expresson inside p() .

Currently i am using the below expression which is not working:-

MachineName=p({<Date={">=$(=date(floor(monthstart(addmonths(today()-4))),'DD-MM-YYYY'))"}*{'<$(=date(floor(monthstart(addmonths(today()-1))),'DD-MM-YYYY'))"} )



12 Replies
jagan
Partner - Champion III
Partner - Champion III

HI,

Try like this

MachineName=p({<Date={">=$(=date(floor(monthstart(today(),-4)),'DD-MM-YYYY'))<$(=date(floor(monthstart(today(), -1)),'DD-MM-YYYY'))"} )


Hope this helps you.


Regards,

Jagan.

HirisH_V7
Master
Master

Hi,

May be like this,

=Only({<MachineName=P({< Date={">=$(=Date(Max(Date)-3))<=$(=Date(Max(Date)))"}>}MachineName)>}MachineName)

or

=Only({<MachineName=P({<Date={">=$(=Date(Today()-3))<=$(=Today())"}>MachineName)>}MachineName)

Hope this Helps,

Hirish

HirisH
Pulkit_Thukral
Partner - Creator II
Partner - Creator II
Author

Hi Hirsh,

can the above expression be included within an expression ?

i tried it but it is giving an error.

Pulkit_Thukral
Partner - Creator II
Partner - Creator II
Author

Tried it but not working jagan.

Kushal_Chawda

Make sure that your Date Field is in proper date format, try below


MachineName=p({<Date={">=$(=date(monthstart(addmonths(today(),-4))))<=$(=date(monthstart(addmonths(today(),-1))))"} )

HirisH_V7
Master
Master

Hi,

Your Data is Current or not?

if Current Go for Second expression, else go with First one,

Can you make a sample app with a sample data.That way we can see the issue!

-Hirish

HirisH
Pulkit_Thukral
Partner - Creator II
Partner - Creator II
Author

it is in a proper date format still the expression is not working

sunny_talwar

Can you share what is the format that you date field is in?

Pulkit_Thukral
Partner - Creator II
Partner - Creator II
Author

i checked with 2 formats-

date(Date,'MM/DD/YYYY')

and

date(Date,'MM/DD/YYYY hh:mm:ss')