Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

expressions with current/previous months

Hello guys,

I am very new to qlikview and I've been trying to solve this problem for a while now.

I found a lot of answers on the forum, but none that could help me (probably because I'm still fairly new).

I have a document with colums year (f.e. 2016) and month (f.e. Jan).

Now I'm trying to get an expression that offers me the sum of another column for the most recent month.

Found a lot of expressions on the forum, but they don't seem to help, maybe I made a mistake in my script or with formatting?

Could someone please provide me of an adequate answer?

(I'm sorry if I didn't post in the right section or in the right way, as I said I'm really new to Qlikview).

Thanks in advance!

4 Replies
Not applicable
Author

In addition, one of the expressions I've already tried:

=num(sum({<Year={$(=year(today()))},Month={'$(=upper(Month(today())))'}>}[001 - 007]),'€ ###.###.###,##0')

sunny_talwar

Is there a sample you can share? Would be good to know how the data is structured and where exactly are you trying to use it.

Not applicable
Author

Thank you for your response, but I've actually found it with a bit of help. Might some people encounter the same problem they will benefit of my solution:

Most recent month:

=sum({$<DateAB={"$(=max(DateAB))"}>}[FIELD])

Previous month:

=sum( { < DateAB= {$(=Date(max(DateAB)-1,'YYYYMM'))} > } [FIELD]

DateAB being structured as followed: Date(DateAB,'MMM-YYYY') as DateAB,

Have a nice day!

Kushal_Chawda

Make sure that Your month field is calculated using Month function


=Sum({<YourYearField = {"$(=max(YourYearField))"}, YourMonthField ={"$(=max(YourMonthField))"}>}Sales)