Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
v_jaideep
Creator
Creator

Current Price vs Launch Price

Experts,

Can you please help me on below:

I have each product with multiple prices with start and end date changing. I need the Current Price and Launch Price at a given point. Let's say, for product AC- Launch Price is 18.52 on 2019-03-01 but the current price has changed to 12.52 from 2021-01-01. I need to get the launch price(18.52) beside the current Price (12.52)

productpricelaunch_datestart dateend datecurrent_pricelaunch_price
AB37882019-04-022019-10-28 37884450
AB44502019-04-022019-04-022019-10-27-4450
AC12.522019-03-012021-01-01 12.5218.52
AC132019-03-012019-08-032020-12-31 13
AC18.522019-03-012019-03-012019-08-02 18.52
AD1002019-11-012021-01-01 10090
AD1102019-11-012020-06-042020-12-31 110
AD802019-11-012020-03-022020-06-03 80
AD902019-11-012019-11-012020-03-01 90
4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The usual technique is to generate a row for every date in the start/end interval.  Then the data model will have the correct values for every Product/Date combination and no special expression is required. 

You can generate the values using either a While loop or Interval match. Here's an example with your data using While:

Join (Prices)
LOAD
*,
date([start date] + IterNo()-1) as CurrentDate
Resident Prices
WHILE [start date] + IterNo()-1 <= (if(len([end date]) > 0, [end date], Today(2)))
;   

More examples here:
Qlikview Cookbook: Expand A Pricing Date Table

Qlikview Cookbook: Count Days In A Transaction Using Intervalmatch 

-Rob

 

v_jaideep
Creator
Creator
Author

Thanks Rob for the response, however I'm not able to get current Price and launch price in same row for same product.
Below is the table structure  I have .

Table A:
Start_date,
End_date,
Local_Price,

currency,
key

Table B:
Launch_date,
product,country,area,region,province,size,unit

name,
key

 

Expected data in table should be as below:

Product     Current_Price    Launch_Price

AB               3788                         4450

AC               12.52                       18.52

AD                100                                90

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I assume Current_Price comes from Local_Price?  Are you saying you can't link values from TableA and TableB together?  If so, perhaps the key values do not match. 

-Rob

v_jaideep
Creator
Creator
Author

@rwunderlich ,Yes current price and launch price come from local price.And I'm able lo link Table A and Table B.We already have end-date available.

We need to get current price and launch price only based on product.

 

-Jaideep