Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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

Tags (1)
15 Replies
MVP
MVP

Re: Start date to today

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

Re: Start date to today

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

let vEnovaMinDate=11-30-2014;

Is it correct way to assign the date to variable?

balrajahlawat
Esteemed Contributor

Re: Start date to today

Try this:


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

MVP
MVP

Re: Start date to today

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)

Re: Start date to today

Create variable as

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


Now try your expression ,it should work

Not applicable

Re: Start date to today

Thanks for the reply, not working,

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

balrajahlawat
Esteemed Contributor

Re: Start date to today

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

Re: Start date to today

Sorry not working,

why we need to define like that,

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

Not applicable

Re: Start date to today

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