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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Insert Value between dates which are not available in database

Hi

I have data in data source like below:

Product      SalesDate     Value

A               01-01-2012     $100

A               01-04-2012     $50

So there is no sale in Feb-12 and Mar-12,But the requirement is to show.

Product     Date

A               01-01-2012     01-02-2012     01-03-2012     01-04-2012

                    $100               $0               $0                    $50.

Kindly help me.

Regards

Aaron

7 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Maintain separate calendar for this type of requirements which is generated by your own.

There is lots of code to generate master calendar available in community post search for it.

Refer this

http://community.qlik.com/thread/48693

shree909
Partner - Specialist II
Partner - Specialist II

u can use inline table  if u have less values

if you  have more data than either u need to request from ur database team to proide the dates with 0 value OR do  hardcoding the values...

its_anandrjs
Champion III
Champion III

Hi,

Use autogenerate for date generation

Regards,

Anand

Not applicable
Author

Hi Ajmal,

As Shree Sai, you can use the Inline and add the dates ,if their are less record otherwise you need to add at the database side only.

Regards,

Ramesh

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Attached is a simple example. I hope this helps you find the answer to your question.


talk is cheap, supply exceeds demand
its_anandrjs
Champion III
Champion III

Hi,

Create table like this

Let varMinDate = Num(Makedate(2012,1,1));

Let varMaxDate = Num(Makedate(2012,1,4));

     

load

date($(varMinDate)+IterNo()-1) as SalesDate

AutoGenerate (1)

While $(varMinDate)+IterNo()-1 <= $(varMaxDate);

   

Temp:

load * inline

[

Product,SalesDate,Value

A, 01/01/2012,  $100

A, 01/04/2012,  $50

];

HTH

Regards,

Anand

Not applicable
Author

Thanks Everyone..its very helpful to me