Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

morning guys

can any one help:

is there anything wrong with the following expression:

      • Sum({$<MonthID = {“<=$(=Max(MonthID))”}, Year = {$(=Max(Year))}, Quarter = , Month = >} Sales)

10 Replies
Highlighted
Specialist III
Specialist III

Re: morning guys

What is your requirement and what outcome you are getting from this?

Highlighted
Not applicable

Re: morning guys

Hi Sen,

my requirements is to get Year_To_Date(YTD):

I think there is something wrong with the expression as it populate dashes on the filed.

Highlighted
MVP
MVP

Re: morning guys

MonthID and Month might be in conflict with each other. The last criteria Month might cancel out the earlier MonthID selection.

Highlighted
Master III
Master III

Re: morning guys

Highlighted
Not applicable

Re: morning guys

Hi Settu,

I have the YTD,QTD,MTD and WTD but I want the previous period:

LYTD, LQTD, LMTD, PRIOR_YEAR_MTD, LWTD and PRIORYEAR_WTD

Highlighted
Master III
Master III

Re: morning guys

Highlighted
Creator III
Creator III

Re: morning guys

YTD Previous:

num(SUM({<Year={'$(vPriorYear)'},Month=,Day=,Num={'<=$(vPriorYearDate)'},MonthYear=,Quarter=,Flag={'Actual'}>}[Net Sales]),'##,##0')

vPriorYear=(vMaxYear) -1

vPriorYearDate=num(date(addyears(max(Num), -1), 'DD MMM YYYY'))

Highlighted
Not applicable

Re: morning guys

Hi Settu,

I m going to have to update the numbers manually?

Highlighted
Specialist II
Specialist II

Re: morning guys

if u have MonthOrderID then use like

  • Currernt YTD:
  • Sum({$<   MonthOrderID{"$(=Max({<Year={$(=Max(Year))}>}MonthOrderID))"}>} Sales)

  • Previous YTD:
  • Sum({$<   MonthOrderID{"$(=Max({<Year={$(=Max(Year)-1)}>}MonthOrderID))"}, Quarter = , Month = ,Year=>} Sales)