Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
slribeiro
Partner - Creator
Partner - Creator

Dimension Month

Greetings,

i need some help with my dimension Month.

The thing is that i want to limit my dimension month only to the one selected and the 2 before that one.

i have something like this but is something wrong

if (dsc_mes = {>=$(=max(dsc_mes),-3)<=$(=max(dsc_mes))>}, dsc_mes, ' ')

Regards

Simão Ribeiro

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

if (dsc_mes<=Num(month(Today())) and dsc_mes >= Num(addmonth(today(),-2)), dsc_mes , null)

then check the "suppress when value is null" box

let me knoew

sunny_talwar

I think instead of doing this on Month itself, you should try doing this on MonthYear field. May be this:

Aggr(Only({1<MonthYear = {"$(='>=' & MonthName(AddMonths(Max(MonthYear), -2)) & '<=' & MonthName(Max(MonthYear)))"}>} dsc_mes), dsc_mes)

Where MonthYear field is created in the script like this:

MonthName(DateField) as MonthYear

syukyo_zhu
Creator III
Creator III

Hi,

Try to use your condition in your expression.

Anonymous
Not applicable

you cannot use set Analysis without an Aggregation function

you can use

if (dsc_mes >=addmonths(max(dsc_mes),-3) and dsc_mes<=max(dsc_mes), dsc_mes, null())

maybe this doesnot work

then you can define a variable with vMaxMonth = max(dsc_mes) and use variable in your calculated Dimension

if (dsc_mes >=addmonths(vMaxMonth),-3) and dsc_mes<=vMaxMonth,dsc_mes, null())

Not applicable

Hi,

Maybe this can help you:

1. With this select for example the sales of currently month:

sum( {$<Month = {$(=Only(Month))}>} Sales )

2. With this select the sales for the previous month in relation to the current selection:

sum( {$<Month= {$(=Only(Month)-1)}>} Sales )

Regards

Hugo