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: 
sculptorlv
Creator III
Creator III

Date quires

I deleted my previous topic - SQL quires where correct.

My real problem is with qlikview query :

LOAD

FA_Location_Subcode,

SUM(Bought_Quantity) AS Bought_Last_Month


RESIDENT DATASOURCE_SALES

WHERE

MONTHNAME(Bought_Date) = MONTHNAME(Today())-1

GROUP BY

FA_Location_Subcode;



As a result I got ZERO data. I think because of this restriction:

MONTHNAME(Bought_Date) = MONTHNAME(Today())-1


I need all data from December 2017 ...


How can I correct my formulas?

I hope for your help!

1 Solution

Accepted Solutions
mdmukramali
Specialist III
Specialist III

Hi,

Same Data You want to take it for the Last Month?

If Yes then can you try something like this:

=MonthName(MonthStart(Today())-1)

View solution in original post

8 Replies
tresesco
MVP
MVP

May be this?

MONTHNAME(Bought_Date) = MONTHNAME(Today() ,-1)

sculptorlv
Creator III
Creator III
Author

sintax error

sculptorlv
Creator III
Creator III
Author

I have made some tests:

The code is:

Code.png

And the result is:

result.png

So, How can I correctly get -1 Month in order to compare second and fourth columns?

PrashantSangle

search in help menu

http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/da...

What are you trying to achieve??

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 🙂
sculptorlv
Creator III
Creator III
Author

I need to take all data with date of previous month

tresesco
MVP
MVP

The syntax error must be somewhere else. Could you post the screenshot of the error and the script snippet?

mdmukramali
Specialist III
Specialist III

Hi,

Same Data You want to take it for the Last Month?

If Yes then can you try something like this:

=MonthName(MonthStart(Today())-1)

sculptorlv
Creator III
Creator III
Author

OMG .. so simple, I feel stupid! Thank you very much!