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

easy question probably about custom label for month selection

Hi,

I have a requirement where I have a table which shows me 12 months of data if I select any month

So if I select Mar-2018 table shows me

Jan, Feb+Jan, Mar+Feb+Jan, Apr+Mar+Feb+Jan and so on... for 12 months and dimension here is YearMonth.

This data is based on actuals and budget

So if I select Mar

The data for months less than or equal to Mar should have label as Actual 

and Date from Apr to Dec should have label as Budget

I tried quite a few expressions but doesn't seem to get it.

This label is dynamic... I can select any month here but selected and previous months are always Actuals in label, months falling after current selection are labeled as budget.

any help is appreciated.

@sunny_talwar

Labels (1)
22 Replies
MK9885
Master II
Master II
Author

Can you make an expression out of this?
Maxstring({$<$(setYTD)>}Month)as Actual
and anything after
Minstring({$<$(setROY)>}Month) is Budget
Maxstring({$<$(setROY)>}Month) will give last month in calendar year.
I tried these expressions too but didn't work
MK9885
Master II
Master II
Author

Hi, anything, anyone?
MK9885
Master II
Master II
Author

@sunny_talwar I tried

=if(GetCurrentSelections()> only({ < Month = {"<=$(=num(Month))"}>}[Month Number]),'A'ctual,'Budget')2019-01-07_094547.png

 

with this normally I get 

MK9885
Master II
Master II
Author

Was just testing in Qlik view but when I used this expression in my qliksense chart, it doesn't work.
sunny_talwar

Would you be able to share a sample where we can see the issue?

MK9885
Master II
Master II
Author

Ok, will scramble the data and upload it.
Thanks.
sunny_talwar

Thanks Khan_Mohammed

MK9885
Master II
Master II
Author

PFA.

Thanks.

Note: The edit script is hidden... reading from QVD's not xl file so cannot reload.

sunny_talwar

You want something like this?

image.png

Try this as your calculated dimension

=Aggr(Only({1} YearMonth) & Chr(13) & If(Only({1} [Year Month Num]) <= Only(TOTAL [Year Month Num]), 'Actual', 'Budget'), YearMonth)
MK9885
Master II
Master II
Author

Thats exactly what I needed.
always a life saver, Sunny.

Thanks.