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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis and current month

Hi ALL,

i want sum my sales for currentmonth, how can i do his?

sum( {$<Month(maxMonth>} Sales.Amount) not working

pleae help

1 Solution

Accepted Solutions
tresesco
MVP
MVP

This?

Sum({<Month={"$(=MaxString(Month))"}>} Sales.Amount)

View solution in original post

5 Replies
tresesco
MVP
MVP

May be like:

Sum({<MonthField={"$(=Max(MonthField))"}>} Sales.Amount)

Assuming your monthfield is created in the script using month().

sujeetsingh
Master III
Master III

sum( {$<Month={$(=Month(maxMonth))}>} Sales.Amount)



Not applicable
Author

still not working, my master calendar script is:

UNQUALIFY *;

Min:

LOAD

  min (Date) as MinDate

resident Fact;

Max:

LOAD

  max (Date) as MaxDate

resident Fact;

vMinDate = Peek('MinDate',0,'Min'); 

vMaxDate = Peek('MaxDate',-1,'Max');

Temp:

LOAD

    date($(vMinDate) + RowNo() - 1) as Date

AutoGenerate

    $(vMaxDate) - $(vMinDate) + 1

;

Calendar:

Load

  Date as Date,

  Month(Date) as Month,

  Year(Date) as Year,

  Week(Date) as Week,

  WeekDay(Date) as WeekDay,

  Day(Date) as Day,

  'Q'&Ceil(Month(Date)/3) as Quarter,

  'H'&Ceil(Month(Date)/6) as HalfYear,

  MonthName(Date) as YearMonth,

  Year(Date) &'-Q'& Ceil(Month(Date)/3) as YearQuarter,

  Year(Date) &'-H'& Ceil(Month(Date)/6) as YearHalfYear

resident Temp;

drop tables Min,Max,Temp;

tresesco
MVP
MVP

This?

Sum({<Month={"$(=MaxString(Month))"}>} Sales.Amount)

Not applicable
Author

works great, thanks