Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Quantity sum <= today

Hi,

I am trying to sum QTY for week_min_date <= today and other conditions.

But, the date condition is not working.

Please Help ASAP.

Thanks,

Rahul

Sum({$<date[week_min_date]={">=$((today()))"},week_flag={'P'},week_Act={'Discharging'}, LocationId={250} >} QTY)  

11 Replies
Not applicable

Re: Quantity sum <= today

you can use expression on field like this date[week_min_date]

you can format de date on conditinal for value be equal your fiel

exemple field_date={"$(=date(today(),'DD/MM/YYYY'))"}

what is the format your field week_min_date?

Not applicable

Re: Quantity sum <= today

Hi,

Thanks for the response.

The date format is same for today and my date field.

Still it is not working.

Actually, by default, I want to show qty sum <= today in a KPI.

Thanks,

Rahul

MVP
MVP

Re: Quantity sum <= today

Possibly the date format mismatch would be causing the issue. Could you post a sample qvw?

susovan_g
Valued Contributor

Re: Quantity sum <= today

Hi Rahul,

You can also try this below expression,

Sum({$<[week_min_date]={">=$(=today())"},week_flag={'P'},week_Act={'Discharging'}, LocationId={250} >} QTY) 

Not applicable

Re: Quantity sum <= today

No,its not working.

Still it is not working.

Actually, by default, I want to show qty sum <= today in a KPI.

Thanks,

Rahul

MVP
MVP

Re: Quantity sum <= today

Is your date '[week_min_date]' a date field or a text field. I see, you are trying to use date() around the date field in your set expression. Check in the list box, if the date field is left-aligned or right-aligned. If right-aligned, the following expression style should work.

=Sum({<[week_min_date]={'<=$(=Today())'}>}QTY)

If left-aligned, it's a text field, you have to correct it in the script like:

Date(Date#([week_min_date], 'format')) as [week_min_date]

MindaugasBacius
Valued Contributor II

Re: Quantity sum <= today

You have forgotten "=" sign:

Sum({$<date[week_min_date]={">=$(=today())"},week_flag={'P'},week_Act={'Discharging'}, LocationId={250} >} QTY) 

Not applicable

Re: Quantity sum <= today

Sorry, still not working.

This I have tried.

Actually, by default on a sheet,  I want to show qty sum <= today in a KPI.

Thanks,

Rahul

Not applicable

Re: Quantity sum <= today

One thing to be noted that the today() is not appearing in brown/blue color.

Does it gives any guesses to you??

Community Browser