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

min and max price date range

Hi experts

I do have a requirement where I need to show current price, previous day price, min price (10 day ), max price (10 Day).

please see sample data

   

Prodcut IdBusinessDatePrice
ABC12342015-06-1981
ABC12342015-06-1882
ABC12342015-06-1783
ABC12342015-06-1678
ABC12342015-06-1574
ABC12342015-06-1275
ABC12342015-06-1189
ABC12342015-06-1091
ABC12342015-06-0988
ABC12342015-06-0873
ABC12342015-06-0772
ABC12342015-06-0669
ABC12342015-06-0571
ABC12342015-06-0488
ABC12342015-06-0381
ABC12342015-06-0289

so, if select June 19 o/p table should look

     

Product IdCurrent PricePrevious Day PriceMin Price (10 Days) max Price (10 Days)
ABC123481827391

so, if select June 18 o/p table should look

     

Product IdCurrent PricePrevious Day PriceMin Price (10 Days) max Price (10 Days)
ABC123482837291

please help

5 Replies
sunny_talwar

PFA.

Best,

Sunny

maxgro
MVP
MVP

1.png

only({$ <BusinessDate={"$(=date(max(BusinessDate)-1))"}>} Price)

min({$ <BusinessDate={">=$(=date(max(BusinessDate)-11))<=$(=date(max(BusinessDate)))"}>} Price)

max({$ <BusinessDate={">=$(=date(max(BusinessDate)-11))<=$(=date(max(BusinessDate)))"}>} Price)

Clever_Anjos
Employee
Employee

Please find attached

Not applicable
Author

Thx Massimo I think this formula is working, but can you let me know how to exlcude weekends in the range. Thanks for the help.

Not applicable
Author

Hi Sunindia,

can you let me know the logic how this formula works, when I try to implement I'm getting blank values.

Thx for help