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

Getting data based on month irrespective of Date Selected

Hi Gurus,

I got stuck in a Scenario where i need to get data in a manner that whatever the date selected in a calendar month the it has to fetch the data in based on the month selected rather than date because the client is tracking on a month basis and providing data in summarized manner with month end date as scenario. and the client want the calendar object as well to input dates.

The basic Problem i got stuck to populate the month value irrespective of date selected in the particular month.

Can i know how to fix this???

Thanks

MRKachhiaIMPdvqlikviewtresescogwassenaarjagancelambarasanScriptingApp Developmentgwassenaarswuehlmassimo.morelli

4 Replies
PrashantSangle

Hi,

Create MonthYear Field in Script using MonthName()

then in Set analysis try like

Sum({<MonthName={"$(=MonthYear(YourDateField))"},YourDateField=>}Sales)

YourDateField is your selection date Field.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Thank you... will check and update how it went,

Can you help me with, what if i want to find the previous month data

Thanks.

PrashantSangle

Hi,

Use Addmonth()

like AddMonth(dateField,-1)

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

For Current Month

Sum({<MonthFieldNameName=, DateFieldName={'>=$(=MonthStart(Max(DateFieldName)))<=$(=Date(Max(Today())))'}>}Sales)


For Previous Month

For Current Month

Sum({<MonthFieldNameName=, DateFieldName={'>=$(=MonthStart(Max(DateFieldName), -1))<=$(=MonthEnd(Max(Today()), -1))'}>}Sales)