Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Defaulting to Current Month with option to Change Month

Qlik World,

I have an expression for a simple bar chart: sum({<LastMonth={1}, BUDGET_ACTUALS={'BUDGET'}>} HEADCOUNT)

This displays the budget of the previous month's headcount, but I am wanting to have it be where the deafult remains the same and allows for past months to also display.

post.jpg

Two part question:

  1. How can I edit this expression to allow for this? I already have a month list box on the app, so that part is already done for once I can select a past month.
  2. Is there a way to make the title of the object dynamic? It is currently erroneously called Current Month Headcount since it defaults to that view, but once I select a past month, I would like for the title to dynamically become Monthly Headcount.

Regards and many thanks,

JB

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Perhaps this using Title as measure

='You selected' & Concat(Chr(39) & Month & Chr(39), ',') & 'and the count is' & Count(Month)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

9 Replies
Anil_Babu_Samineni

Perhaps this using Title as measure

='You selected' & Concat(Chr(39) & Month & Chr(39), ',') & 'and the count is' & Count(Month)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

I'll give that a try and get back to you real soon, Anil. Thanks!

Anonymous
Not applicable
Author

Anil, that worked for the dynamic title component, very much appreciated. Any advice on the other part regarding having the current month display as the default view with the option to change it with the month selection?

Anil_Babu_Samineni

Perhaps this?

=If(GetFieldSelections(Month)>0, 'Current Month headcount', 'You selected' & Concat(Chr(39) & Month & Chr(39), ',') & 'and the count is' & Count(Month))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

That hasn't worked yet, but I am trying to replace a few terms at the moment and will let you know how it goes. Thanks!

Anil_Babu_Samineni

If above one replicate your issue, I think the one which latest should work. May be inter place from last to first like

=If(GetFieldSelections(Month)>0, 'You selected' & Concat(Chr(39) & Month & Chr(39), ',') & 'and the count is' & Count(Month), 'Current Month headcount')


Or

=If(GetFieldSelections(Month)>0, 'You selected' & Concat(Chr(39) & Month & Chr(39), ',') & 'and the count is' & Count(Month), Your Default Measure)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

This ended up working for me:

if(isnull(GetCurrentSelections()),sum({<CurentMonth={1}, BUDGET_ACTUALS={'BUDGET'}>} HEADCOUNT), sum({<BUDGET_ACTUALS={'BUDGET'}>} HEADCOUNT))

Anonymous
Not applicable
Author

There is a similar table with the same filter issue. We have been able to apply some of the solutions that have been suggested here to this table, but we have some issues.

We would like to display Overhead Details with the below columns shown here with no filters applied:

snip 3.png

However, we need to be able to filter by month or quarter. As some of the columns are month-specific, we are not sure how to modify the table to display relevant data.

snip2.png

Notice that the current month actual below is the same as the current quarter actual when we have selected to filter by a fiscal month. The current quarter actual needs to include January-March, not only January as it shows now. Currently, if a quarter were selected, then the actuals and the budget display fine.

Here is our current expression for the current quarter budget:snip1.png

Anonymous
Not applicable
Author

Here is the expression for column "Cur Qtr Act":

if(isnull(GetCurrentSelections()), sum({<CurrentQuarter={1}, BUDGET_ACTUALS={'BUDGET'}>}DOLLARS)/1000, sum({<BUDGET_ACTUALS={'BUDGET'}>}DOLLARS)/1000)


It currently returns the same data as "Cur Mon Act" but it should be returning the cumulative actuals for all three months in a given

quarter.

Here is how we define Current Quarter in the data model:

if(ceil([Fiscal Month Number]/3)= ceil(Month(today())/3), 1, 0) as CurrentQuarter,

Thoughts?