Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select moore months in Set Analys

Hello,

is it possible to get this?

If I select a year and lets say febr and mars  and get the result for the same months in a set analysis like this?

this is what I have stored in a variable for Last Year Month Today and of course I only get the last mont in my selection.

Can I change it in some way to get the two selected months?

PeriodID = {$(=Max(PeriodID) - 12)},

Year = {$(=Max(Year)-1)},

Quarter = ,

Period = ,

Month =

Håkan

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

I'm not sure if I understand your case correctly but If you just want to show value for selected months from the year before theoretically you don't have to use PeriodID. That should be enough:

sum({$<Year = {$(=Max(Year)-1)}>} Field)

If you select Year and Jan,Mar you will get sum from Jan and Mar from the last year.

BR,

Milosz

View solution in original post

18 Replies
adamdavi3s
Master
Master

OK so you're selecting Year and Month?

If so then

sum({<PeriodID={">=$(=Max(PeriodID) - 12)"}>}yourfield)

as this will in theory show all 12 months, but because you've selected month it will restrict it.

Sorry if I have missed the point the requirement isn't totally clear to me

Not applicable
Author

Hi,

I'm not sure if I understand your case correctly but If you just want to show value for selected months from the year before theoretically you don't have to use PeriodID. That should be enough:

sum({$<Year = {$(=Max(Year)-1)}>} Field)

If you select Year and Jan,Mar you will get sum from Jan and Mar from the last year.

BR,

Milosz

View solution in original post

Not applicable
Author

If I choose like this:

Calend.png

I get only the value of mars in LYMTD when I use this, it works fine when you select only one

mont but not if you select more months.

PeriodID = {$(=Max(PeriodID) - 12)},

Year = {$(=Max(Year)-1)},

Quarter = ,

Period = ,

Month =

MTD.png

hemachandran
Partner
Partner

HI,

Try This Expression

=sum({$<CstFiscalYear={$(=max(CstFiscalYear)-1)}>}UnitActual)

Dont use period PeriodID in your expression..

adamdavi3s
Master
Master

Ok what is your formula for LYMTD?

sasiparupudi1
Master III
Master III

Use a period range

ex:

PeriodID = {">=$(=Max(PeriodID) - 12)<$(=Max(PeriodID))"}

Year =,

Quarter = ,

Period = ,

Month =

hth

Sas

adamdavi3s
Master
Master

or just PeriodID={">=$(=Max(PeriodID) - 12) as i suggested above.

<$(=Max(PeriodID)) is a given, assuming of course you meant to write <=$(=Max(PeriodID))

neha_shirsath
Specialist
Specialist

Hi,

I'm not sure i got your point correctly, means you want to show rolling 12 months?

sum({<cal_yr=,cal_month_abr_name=,cal_prd=,cal_prd_seq ={"<=$(=max(cal_prd_seq)) >$(=max(cal_prd_seq)-12) "},

>}Sales)

Thanks & Regards,

Neha S.

adamdavi3s
Master
Master

In fact why not ditch the period totally, you don't need anything for it at all

PeriodID =,

Year = {$(=Max(Year)-1)},

Quarter = ,

Period = ,

Month =