Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Script

Hi Guys

I have the data in the folowing format

ProductId       Amt     Date

1                     100     01/08/2012

2                      150     03/08/2012

1                      200     04/08/2012

2                       300     05/08/2012

The above date column will be linked to the master Calendar

So My requirement is that when the User will click on Say 02/08/2012 or 03/08/2012 then

i should get

ProductId  Amt

1                100

and when the User will click on 05/08/2012

then

ProductId Amt

1               200

Similarly for the productId 2

4 Replies
somenathroy
Contributor III

Re: Script

Hi,

Create Straight Table and add ProductID as dimension and add

Only({<Date = {'$(=Max({< Date = {"<$(=Max(Date))"} >} Date))'}>} Amt) as expression.

For your ready reference find the attachement.

Regards,

som

Not applicable

Re: Script

Thanks for the reply... but can i do it in Back End ... may be by using Intervalmatch???

somenathroy
Contributor III

Re: Script

Hi Manish,

My previous post needs a small updatation:

Updated Script:

LOAD ProductId, Amt, Date(Date#(Date,'DD/MM/YYYY'), 'DD/MM/YYYY') as Date, Date(Date#(Date,'DD/MM/YYYY'), 'DD/MM/YYYY') as DateAvailable;

LOAD * inline

[ProductId   ,    Amt  ,   Date

1         ,            100   , 01/08/2012

2          ,            150    , 03/08/2012

1            ,          200     ,04/08/2012

2           ,            300   ,  05/08/2012];

Updated Expression:

Only({<Date = {'$(=Max({< DateAvailable = {"<$(=Max(Date))"} >} DateAvailable))'}>} Amt)

Regards,

Som


Employee
Employee

Re: Script

I wouldn't use Set Analysis for this. I would do it in the script by propagating the value from the previous day to the next.. 

See attachment for a script solution.

HIC

Community Browser