Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hi need a help for this expression...

i am this expression in my report to take only recent month last date sales only

it's work correct...

financial year, quarter it 's work perfect

if i click on month or date field it's going blank

dimension branch

Sum({<NumDate={'$(=floor(Num(max(MonthEnd(NumDate,-1)))))'}>}StockClosing_GROSSWEIGHT)

here in the above expression numdate nothing in script it floor(date) as numdate.

so even though i click any month or any date it needs to show only recent month monthend date stock only

actually we use to take only monthend's stock only get exact stock figures for closing stock.

Thanks in advance..

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Remove '-1' from monthend() and try like:

Sum({<MonthField,DateField, NumDate={'$(=floor(MonthEnd(Max(NumDate))))'}>}StockClosing_GROSSWEIGHT)

View solution in original post

6 Replies
tresesco
MVP
MVP

Try:

Sum({<NumDate={'$(=floor(MonthEnd(Max(NumDate),-1)))'}>}StockClosing_GROSSWEIGHT)

Not applicable
Author

i just used what you suggested but still it's showing blank tresesco

for me fin year and quarter it's showing correct this expression but month and date field selections showing blank...

tresesco
MVP
MVP

Try with this corrected one:


Sum({<MonthField,DateField, NumDate={'$(=floor(MonthEnd(Max(NumDate),-1)))'}>}StockClosing_GROSSWEIGHT)

Not applicable
Author

thanks it's working fine...

but another problem is there

if i click on feb month it's showing jan month enddate sales if i click on jan it's shoing dec month enddate sales.....

i requirement is if click on april since we didn't have last date in april it need to take march31 stock...

if i click on feb month since we have feb month last date so it need to take feb month last date sales only

thanks 

tresesco
MVP
MVP

Remove '-1' from monthend() and try like:

Sum({<MonthField,DateField, NumDate={'$(=floor(MonthEnd(Max(NumDate))))'}>}StockClosing_GROSSWEIGHT)

Not applicable
Author

Thanks a lot for your help

i got idea and did like this

=if(GetSelectedCount(Month)>0 or GetSelectedCount(NumDate)>0,

Sum({<Month=,BILLDATE=,NumDate={'$(=floor(MonthEnd(Max(NumDate))))'}>}StockClosing_GROSSWEIGHT)/WeightFlag,

(sum({<NumDate={'$(=floor(Num(max(MonthEnd(NumDate,-1)))))'}>}StockClosing_GROSSWEIGHT))/WeightFlag)

it's working fine now....