Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

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
Author

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

tresesco
MVP
MVP

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

susovan
Partner - Specialist
Partner - Specialist

Hi Rahul,

You can also try this below expression,

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

Warm Regards,
Susovan
Not applicable
Author

No,its not working.

Still it is not working.

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

Thanks,

Rahul

tresesco
MVP
MVP

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
Partner - Specialist III
Partner - Specialist III

You have forgotten "=" sign:

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

Not applicable
Author

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
Author

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

Does it gives any guesses to you??