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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

This?

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

View solution in original post

5 Replies
tresB
Champion III
Champion III

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;

tresB
Champion III
Champion III

This?

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

Not applicable
Author

works great, thanks