Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Tell us which business and trade publications you read most regularly: RESPOND NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
UserID2626
Creator III
Creator III

Monthend logic in script qlik sense

Hi,

I have to requirement to bring monthstart & Monthend value alone

And my chart is last 6 months of

          dimension : MonthName(business_date)

          Measure  :

Sum({<business_date=(">=$(=monthstart(max(business_date),-5))<=$(=monthend(max(business_date),-5))" >}Amount) for total

Sum({<business_date=("$(=monthstart(max(business_date)))" >}Amount) for Opening //Not working

Sum({<business_date=("$(=monthend(max(business_date)))" >}Amount) for Closing  //Not working

 

So Tried in script

Load

business_date,

Amount,

if(business_date=Monthstart(business_date),Amount,Null) as opening, //Ok

if(business_date=Monthend(business_date),Amount,Null) as ending //incorrect

From Table1;

Help me to get opening and ending alone

 

Labels (3)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

if(Floor(business_date)=Floor(Monthend(business_date)),Amount,Null) as ending 

View solution in original post

3 Replies
tresesco
MVP
MVP

Try like:

if(Floor(business_date)=Floor(Monthend(business_date)),Amount,Null) as ending 

UserID2626
Creator III
Creator III
Author

 

Thanks  ,Its working

But another issue.  My app was based on daily data.

So for April 2020,i have data only till April 02. In that case need to show April 02 Amount value as closing.

 

 

 

 

tresesco
MVP
MVP

Try something like:

Sum({<business_date=('$(=date(max(business_date)))' >}Amount)