Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sunilkumarqv
Specialist II
Specialist II

Date Selections

     I have a dates like 1/31/2010,1/31/2011,1/31/2012,1/31/2013 (M/DD/YYY)

.I created chart above date as dimension ,So here if selected date 1/31/2012 in chart showing only 1/31/2012 I  pervious dates will be diappered .  I want to be presented previous dates as well I will appricate any one heelp me.

16 Replies
MK_QSL
MVP
MVP

Can you upload your sample apps?

Update :

You can use like below

SUM({$<Date = >}Sales)

Not applicable

Hi,

If you are using any aggregated funciton in your chart expression then try to use {<Datefield=>} in SET expression.

sunilkumarqv
Specialist II
Specialist II
Author

Hi Manish

This sceniro works only actual data in database but some dates are dynamically created what to do so.

MK_QSL
MVP
MVP

Better if you share your sample file !

Would love to help you.

qlikvfpi
Partner - Contributor II
Partner - Contributor II

Try this :

sum( {$<Date={'<=$(=Date)'}>}...)

sunilkumarqv
Specialist II
Specialist II
Author

Please see below screen shot  .

i used below script for dynamically created dates and want to be create DateId  for this so i can use in my experssion  as u said.

or any other idea?

set DateFromat='M/D/YYYY';

set vMaxdate=date(today());

Let vStart = date('12/31/2012');

Let vEnd = date('12/31/2014');

LOAD MonthEnd(date) as MonthEndDate;

LOAD Date('$(vStart)' + RecNo()) as MonthEndDate autogenerate '$(vEnd)' - '$(vStart)' ; 

MK_QSL
MVP
MVP

You can create something like below...

Let vStart = NUM(Date('31/12/2012'));

Let vEnd = NUM(Date('31/12/2014'));

TempDate:

Load

  Date($(vStart) + RowNo() - 1) as Temp_Date

AutoGenerate $(vEnd) - $(vStart)+1;

Load AutoNumber(Temp_Date) as DateID,

  Temp_Date as Date

Resident TempDate

Order By Temp_Date;

Drop Table TempDate

sunilkumarqv
Specialist II
Specialist II
Author

Getting Script error

MayilVahanan

SET DateFormat='DD/MM/YYYY';

Let vStart = NUM(Date('31/12/2012'));

Let vEnd = NUM(Date('31/12/2014'));

TempDate:

Load

  Date($(vStart) + RowNo() - 1) as Temp_Date

AutoGenerate $(vEnd) - $(vStart)+1;

Load AutoNumber(Temp_Date) as DateID,

  Temp_Date as Date

Resident TempDate

Order By Temp_Date;

Drop Table TempDate;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.