Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
naveen341
Creator
Creator

How to get first day of each month price in a column for each dimension in straight table

Hi

Can you please help me with getting first day of each month price as new column .

Here is the sample data and expected o/p

Sample Data:

  

DateProductPrice
10/1/2018A100
10/2/2018A200
10/3/2018A300
10/4/2018A300
10/5/2018A300
10/1/2018B500
10/2/2018B150
10/3/2018B300
10/4/2018B250
10/5/2018B600
10/1/2018C20
10/2/2018C30
10/3/2018C80
10/4/2018C110
10/5/2018C60

Expected O/P:

   

DateProductPriceFirst day Price
10/1/2018A100100
10/2/2018A200100
10/3/2018A300100
10/4/2018A300100
10/5/2018A300100
10/1/2018B500500
10/2/2018B150500
10/3/2018B300500
10/4/2018B250500
10/5/2018B600500
10/1/2018C2020
10/2/2018C3020
10/3/2018C8020
10/4/2018C11020
10/5/2018C6020

Appreciate your help

16 Replies
sunny_talwar

I am not sure I follow

naveen341
Creator
Creator
Author

when i use month year for other chart.

first expression: avg({<Year=, Quarter=, Month=, Week=, KeyDate={'>=$(=YearStart(max(KeyDate)))<=$(=max(KeyDate))'}>} PX_Last )

getting jan 2018 value for complete year

second expression:

(FirstSortedValue({<Year, Quarter, Month, Week, KeyDate = {'>=$(=YearStart(Max(Date)))<=$(=Max(Date))'}>} TOTAL <[Index Ticker]> Aggr(avg({<Year, Quarter, Month, Week, KeyDate = {'>=$(=YearStart(Max(Date)))<=$(=Max(Date))'}>} PX_Last),

KeyDate, [Index Ticker]), Aggr(avg({<Year, Quarter, Month, Week, KeyDate = {'>=$(=YearStart(Max(Date)))<=$(=Max(Date))'}>} KeyDate), KeyDate, [Index Ticker])))

second expression is not giving the exact o/p,

Can you please help me

MonthYear Index Ticker monthly (FirstSortedValue({<Year, Quarter, Month, Week, KeyDate = {'>=01/01/2018<=07/31/2018'}>} TOTAL <[Index Ticker]> Aggr(avg({<Year, Quarter, Month, Week, KeyDate = {'>=01/01/2018<=07/31/2018'}>} PX_Last), KeyDate, [Index Ticker]), Aggr(avg({<Year, Quarter, Month, Week, KeyDate = {'>=01/01/2018<=07/31/2018'}>} KeyDate), KeyDate, [Index Ticker]))) //=avg({<Year=, Quarter=, Month=, Week=, KeyDate={'>=$(=YearStart(max(KeyDate)))<=$(=max(KeyDate))'}>} PX_Last )
658.86792105  
Jan 2018G8QI390.11295652396.07400000
Jan 2018JPEIGLBL807.87869565807.95000000
Jan 2018JPEIPLUS834.06739130836.13000000
Feb 2018G8QI374.65700000396.07400000
Feb 2018JPEIGLBL791.63300000807.95000000
Feb 2018JPEIPLUS815.27950000836.13000000
Mar 2018G8QI376.51672727396.07400000
Mar 2018JPEIGLBL790.13954545807.95000000
Mar 2018JPEIPLUS814.19500000836.13000000
Apr 2018G8QI383.20209524396.07400000
Apr 2018JPEIGLBL790.66190476807.95000000
Apr 2018JPEIPLUS815.77523810836.13000000
May 2018G8QI379.92808696396.07400000
May 2018JPEIGLBL772.81739130807.95000000
May 2018JPEIPLUS794.29304348836.13000000
Jun 2018G8QI385.03952381396.07400000
Jun 2018JPEIGLBL766.36809524807.95000000
Jun 2018JPEIPLUS786.19952381836.13000000
Jul 2018G8QI390.81027273396.07400000
Jul 2018JPEIGLBL777.43409091807.95000000
Jul 2018JPEIPLUS797.31181818836.13000000
sunny_talwar

May be this

FirstSortedValue({<Year, Quarter, Month, Week, KeyDate = {'>=$(=YearStart(Max(Date)))<=$(=Max(Date))'}>} TOTAL <[Index Ticker]> Aggr(avg({<Year, Quarter, Month, Week, KeyDate = {'>=$(=YearStart(Max(Date)))<=$(=Max(Date))'}>} PX_Last),

MonthYearField, [Index Ticker]), Aggr(avg({<Year, Quarter, Month, Week, KeyDate = {'>=$(=YearStart(Max(Date)))<=$(=Max(Date))'}>} MonthYearField), MonthYearField, [Index Ticker])))

naveen341
Creator
Creator
Author

Awesome it work thanks Sunny

sunny_talwar

2 things

1) How is your own response "Awesome it work thanks Sunny" a helpful response

2) How is this a thread "Assumed Answer" if my response did work for you as per point number 1 above

I request you to fix the above two things as it helps future visitors to this thread to look for the right answers.

Best,

Sunny

naveen341
Creator
Creator
Author

It was my bad i hit that button without knowingly.

Your response worked for me.

sunny_talwar

Then please fix it . If you don't know how... go through the thread below

Qlik Community Tip: Marking Replies as Correct or Helpful