Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Aspiring_Developer
Creator III
Creator III

show values for last date of each month in table qliksense

Hello,

I have below data :- 

Aspiring_Developer_0-1662459316566.png

 

I need to show the values only for last dates of each month like below :-

Trend_Date | Sum(Value)

30-09-2022 |10

31-08-2022| 20

How can I achieve this ? 

Thanks in advance

 

Labels (1)
2 Solutions

Accepted Solutions
rubenmarin

Hi, you can try with:

=If(MonthEnd(Trend_Date)=Trend_Date, Sum(Value))

It will be better if you have a calendar table in script, then you only need to flag the last aday of the month using the same if condition:

=If(MonthEnd(Trend_Date)=Trend_Date,1,0) as isLastDayOfMonth

And the expression could be:

Sum({<isLastDayOfMonth={1}>} Value)

View solution in original post

rubenmarin

Hi, sorry, monthend will need a floor to remove the time (or set it to 00:00:00)

Floor(MonthEnd(Trend_Date))=Trend_Date

View solution in original post

5 Replies
rubenmarin

Hi, you can try with:

=If(MonthEnd(Trend_Date)=Trend_Date, Sum(Value))

It will be better if you have a calendar table in script, then you only need to flag the last aday of the month using the same if condition:

=If(MonthEnd(Trend_Date)=Trend_Date,1,0) as isLastDayOfMonth

And the expression could be:

Sum({<isLastDayOfMonth={1}>} Value)

Aspiring_Developer
Creator III
Creator III
Author

Hello @rubenmarin 

Thanks for your response. I tried both the approaches but it didn't worked .Please see below:-

1)=If(MonthEnd(Trend_Date)=Trend_Date, Sum(Value))

Aspiring_Developer_0-1662463870012.png

 

2) 

Aspiring_Developer_1-1662463891092.png

Aspiring_Developer_2-1662463933367.png

 

rubenmarin

Hi, sorry, monthend will need a floor to remove the time (or set it to 00:00:00)

Floor(MonthEnd(Trend_Date))=Trend_Date

Aspiring_Developer
Creator III
Creator III
Author

Hello, I did the above:-

Aspiring_Developer_0-1662464658210.png

But it is only giving me the flag value as 0 and not 1. That is why the chart is coming blank. Please see below :-

Aspiring_Developer_1-1662464723237.png

 

Aspiring_Developer_2-1662464834085.png

 

Please correct me if I am doing something wrong.

Thanks

Aspiring_Developer
Creator III
Creator III
Author

Thanks for your solution.

I did the change at backend like below :-

If(floor(MonthEnd(Trend_report_date))=Trend_report_date,1,0) as isLastDayOfMonth,

And then at front end did this :-

Aspiring_Developer_0-1662465114298.png

Thanks again