Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Sebastian_Dec
Creator II
Creator II

Qliksense cumulative month from 01.01 to today by year/month

Hi, I'm wondering how to make the sum of sales from 01.01 of a given year to "today".
so that the sum counts:
a) only after full months
b) after days

For example, today is April 26, so if the user selects the years 2022 and 2023, it should count:
a) January, February, March
b) from 01:01 to 26.04

My code counts the sum only for the range of years, please help, how can I improve it.

First year: Sum({<Year={"$(=(Max(Year)))"}>} Sales)
Second year: Sum({<Year={"$(=(Max(Year)-1))"}>} Sales)

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.
Labels (4)
1 Solution

Accepted Solutions
Sebastian_Dec
Creator II
Creator II
Author

Ok, I make it by Edit expression:

Sum({<MonthNbr={"$(= '=' & (Max(MonthNbr)))"}, Year={"$(=(Max(Year)))"}, Day={"$(= '<=' & (Max(Day)))"}, Data=>} sales)
Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
Prem0212
Creator
Creator

Here  I am giving an example for the similar issue i hope this expression will work   

RangeSum(Above(
Sum({<[Ship Date] = {">=$(=Year([Ship Date]))"}, [Ship Date] = {"<=$(=Today())"}>} Sales),
0,
RowNo()
))

Prem0212_0-1682493250292.png

 

Please accept the solution if u liked it

 

 

Sebastian_Dec
Creator II
Creator II
Author

Thx Prem0212 but somehow I got the error, can you send the qvf for analysis?

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.
Sebastian_Dec
Creator II
Creator II
Author

Ok, I make it by Edit expression:

Sum({<MonthNbr={"$(= '=' & (Max(MonthNbr)))"}, Year={"$(=(Max(Year)))"}, Day={"$(= '<=' & (Max(Day)))"}, Data=>} sales)
Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.