Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
v_jaideep
Creator
Creator

Add New Price Column

Experts,

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

Productpricelaunch_datestart dateend date
AB37884/2/201910/28/2019 
AB44504/2/20194/2/201910/27/2019
AC12.523/1/20191/1/2021 
AC133/1/20198/3/201912/31/2020
AC18.523/1/20193/1/20198/2/2019
AD10011/1/20191/1/2021 
AD11011/1/20196/4/202012/31/2020
AD8011/1/20193/2/20206/3/2020
AD9011/1/201911/1/20193/1/2020

 

Expected data in table should be as below: Launch_price and Current_Price we will get to know from launch_date, start date and end date.

Product     Current_Price    Launch_Price

AB               3788                         4450

AC               12.52                       18.52

AD                100                                90

3 Replies
v_jaideep
Creator
Creator
Author

@Gysbert_Wassenaar , May be you can guide/help me? 🙂 I have tried using firstsortedvalue() . Any suggestion that can be implemented in scripting .

QFabian
Specialist III
Specialist III

Hi @v_jaideep , please see if this works  for you:

Current_Price:
Load
key,
Local_Price as Current_Price
Resident [Table A]
Where isnull([end date]) or [end date] = '';

Launch_Price:
Load
key
min(Start_date) as min_launch_date
Resident [Table A]
Where not isnull([end date]) and [end date] <> ''
group by
key;

left join
Load
key,
Start_dateas min_launch_date
Resident [Table A];

QFabian
v_jaideep
Creator
Creator
Author

@QFabian , Thank you for your response. I did not get why min launch date was considered when we are looking for prices columns(Current and launch price). Also we have launch_date from Table B.