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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Creator III
Creator III

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
Author

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

somenathroy
Creator III
Creator III

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


hic
Former Employee
Former Employee

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