Skip to main content
Solved

Lobby Month filter parameter - Apps9


Forum|alt.badge.img+8
  • Sidekick (Customer)
  • 42 replies

Hi all! 

I’ve created a lot of lobbies on the system but recently more users want to be able to filter their data by month, i.e. either type in April or 04 to filter down lobby results for anything that matched this month. 

Tricky bit is that they simply want to use calendar month. So extracting a month from a date is not ideal. I tried toying with build in calendar_api options but didn’t get far yet. 

Has anyone ever tried this before? 

Best answer by Sajith D

Hi,

 

You can probably achieve this by matching the input parameter (lets say “MM”) against your data source and putting in a internal filter in the source query to look up only the data from this year. This is assuming that your issue stems from the fact that if you only use the Month, the query will return data for the same month for all years.

Simple example is as below

select col1, col3,etc…

from <your_view>

where   to_char(<your_date_column>,'MM') = ‘$MM’ -- this is your input parameter

and to_char(<your_date_column>,'YYYY')= EXTRACT(YEAR FROM sysdate)  --  to get only the curr year

 

Cheers.

View original
Did this topic help you find an answer to your question?

3 replies

JULIAN
Hero
Forum|alt.badge.img+9
  • Hero
  • 75 replies
  • April 21, 2020

What do you mean that users want to use calendar month but extracting month from date is not ideal?

 

so they want to select e.g. April but not a date range (from and to) but also not “writing” April either?

 

Using to_char(date, ‘Month’) would have been first thought but not sure why that is not ideal. 


Forum|alt.badge.img+21
  • Superhero (Employee)
  • 427 replies
  • Answer
  • April 22, 2020

Hi,

 

You can probably achieve this by matching the input parameter (lets say “MM”) against your data source and putting in a internal filter in the source query to look up only the data from this year. This is assuming that your issue stems from the fact that if you only use the Month, the query will return data for the same month for all years.

Simple example is as below

select col1, col3,etc…

from <your_view>

where   to_char(<your_date_column>,'MM') = ‘$MM’ -- this is your input parameter

and to_char(<your_date_column>,'YYYY')= EXTRACT(YEAR FROM sysdate)  --  to get only the curr year

 

Cheers.


Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • 42 replies
  • April 23, 2020

Thanks Sajith! 

 

Think this is the best answer / solution ! :)

 

Thanks!

Kasia 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings