Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Data from particular Date

Hi all,

I am displaying count in KPI Using below expression.

Measures:

count({$<client_id = {12},CanonicalDate = ${">= (vOF_Start_Date)"}>}invitation_id)

vOF_Start_Date is a variable, where i have assigned the date for it.


Let vOF_Start_Date = 04-29-2014;

I need the count from the date 04-29-2014 but it's picking the count from before that.

Anyone help on this.

Regards,

Pramod

8 Replies

Re: Data from particular Date

Hi Kumar,

count({$<client_id = {'12'},CanonicalDate = {">= $(=vOF_Start_Date)"}>}invitation_id)

Not applicable

Re: Data from particular Date

Sorry nagraj,

It's picking all the data.

Not working.

Re: Data from particular Date

Paste the above expression in text box and see whats the value of  $(=vOF_Start_Date).

Edit: Just remove the single quote from client_id = {'12'}. Try below one

count({$<client_id = {12},CanonicalDate = {">= $(=vOF_Start_Date)"}>}invitation_id)

balrajahlawat
Esteemed Contributor

Re: Data from particular Date

try this:

=count({<client_id = {'12'},CanonicalDate ={'>=$(=vOF_Start_Date)'}>} invitation_id)


Also make sure, your CanonicalDate and variable date format both should be same

MVP
MVP

Re: Data from particular Date

First of all, you should not use a Let there. The Let will produce the result -2039 (4 - 29 - 2014). You need to use Set to store a literal.

Set vOF_Start_Date = 04-29-2014;

or

Let vOF_Start_Date = Date#('04-29-2014');

Next - be careful of spaces in a set expression. And the variable reference needs to $ expansion.


=count({$<client_id = {12}, CanonicalDate = ${">=$(vOF_Start_Date)"}>}invitation_id)

or

=count({$<client_id = {12}, CanonicalDate = ${">=$(=vOF_Start_Date)"}>}invitation_id)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: Data from particular Date

Hi nagraj,

when i paste it in textbox $(=vOF_Start_Date), I am getting value as -2039.

Here we are wrong.

If i paste date(vOF_Start_Date)  then i am getting the date of year 1894.

with only (vOF_Start_Date)  blank.

where i am doing wrong

Re: Data from particular Date

The above expression will work only when the $(=vOF_Start_Date) is 04-29-2014. As said by Jonathan you should use set instead of let statement.

Set vOF_Start_Date = 04-29-2014;

Not applicable

Re: Data from particular Date

Hi Jonathan,

I tried all the scenarios please check my sample .qvf.

FYI, I have used different name for variables

Community Browser