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: 
Not applicable

Start date to today

Hi all,

I have a variable with value as date. I need to get the data from that date to today.

For Ex:

vMinDate = 30/11/2014

count({<DateType = {invitation}, CanonicalDate = {">=$(=vMinDate) <=$(=date(today(),'MM-DD-YYYY'))"}>}invitation_id)

I am not getting where i am wrong in expression.

Regards,

Pramod

15 Replies
sunny_talwar

What is the format of your CanonicalDate field? Is it DD/MM/YYYY (which you have for vMinDate) or MM-DD-YYYY which you use for today??

Both of these formats need to be the same and need to match the format for CanonicalDate field.

Not applicable
Author

Yes all in the same format "MM-DD-YYYY"

let vEnovaMinDate=11-30-2014;

Is it correct way to assign the date to variable?

Anonymous
Not applicable
Author

Try this:


=count({<DateType = {'invitation'}, CanonicalDate = {'>=$(=vMinDate)<=$(=date(today(),'MM-DD-YYYY'))'}>} invitation_id)

sunny_talwar

Try this;

=Count({<DateType = {invitation}, CanonicalDate = {">=$(=Date(vMinDate, 'MM-DD-YYYY')) <=$(=date(today(),'MM-DD-YYYY'))"}>}invitation_id)

OR

=Count({<DateType = {invitation}, CanonicalDate = {">=$(=Date(MakeDate(2014, 11, 30), 'MM-DD-YYYY')) <=$(=date(today(),'MM-DD-YYYY'))"}>}invitation_id)

Kushal_Chawda

Create variable as

vMinDate = date(date#('30/11/2014','DD/MM/YYYY'),'MM-DD-YYYY')


Now try your expression ,it should work

Not applicable
Author

Thanks for the reply, not working,

I think i am posted the same expression above except "".

Anonymous
Not applicable
Author

As already shared the expression, use single quotation for invitation like 'invitation':

=count({<DateType = {'invitation'}, CanonicalDate = {'>=$(=vMinDate)<=$(=date(today(),'MM-DD-YYYY'))'}>} invitation_id)


copy and paste this expression

Not applicable
Author

Sorry not working,

why we need to define like that,

we can directly define like 30-11-2014 right?

Not applicable
Author

Yes i tried but not working.

I think my declaration is wrong, because i tried to print it in text box their also i am not getting output