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

Only show monthends in a graph

Hi, 

I have a table with balances for every day of the month for 2 years (2018 to 2020)

two fields: Balance_date, Balance_amount

 

I want a chart that will only show me the monthends for these values.

Dimension would be:  Year(Balance_date)&'-'&Month(Balance_date)

Expression: sum(Balance_amount)

I tried sum({< Balance_date = {'$(=Date(Monthend(Balance_date )))'}>} Balance_amount)

But it obviously didn't work...

 

 

1 Solution

Accepted Solutions
MayilVahanan

Hi @sibrulotte 

You can create one flag in script and use in the set analysis which is very flexible. 

Load Balance_date, Balance_amount,

Dual(Year(Balance_date)&'-'&Month(Balance_date), MonthName(Balance_date)) as MonthYear,

If(Floor(Balance_date) = Floor(MonthEnd(Balance_date)), 1, 0) as Flag

from yoursourcetable;

In front end,

MonthYear as Dimension

and sum({<Flag={1}>}Balance_amount)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
MayilVahanan

Hi @sibrulotte 

You can create one flag in script and use in the set analysis which is very flexible. 

Load Balance_date, Balance_amount,

Dual(Year(Balance_date)&'-'&Month(Balance_date), MonthName(Balance_date)) as MonthYear,

If(Floor(Balance_date) = Floor(MonthEnd(Balance_date)), 1, 0) as Flag

from yoursourcetable;

In front end,

MonthYear as Dimension

and sum({<Flag={1}>}Balance_amount)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Chanty4u
MVP
MVP

Can you try this?

Sum({$<Balance_date ={'$(=MonthEnd(AddMonths(Balance_date), -1))'}>} Balance_amount)

 

or

     if(monthend(Balance_date) = Balance_date, 1,0) as MonthEnd_Flag.     -- script 

 Sum({$<MonthEnd_Flag = {"1"}>} Balance_amount)

Vegar
MVP
MVP

Try this expression.

=sum({<Date = {"=Date=Dayname(Monthend(Date))"}>}Balance_amount)

image.png

See attached qvw

Brett_Bleess
Former Employee
Former Employee

@sibrulotte You have received three good responses on this one, we would appreciate it if you would return to the thread and use the Accept as Solution on the post(s) that helped, or if you have further questions, please leave an update.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.