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

yesterday sale

hi

i need yesterday's sales quantity so i wrote the code below, but it doesn't give true answer. any one knows what problem is with my code?

Sum ({ < [d Gregorian Full Date]={"$(=Date(today()-1))"}>} [F Sr Sales Quantity])

1 Solution

Accepted Solutions
Not applicable
Author

hi

at end i found the problem. its the correct syntax:

Sum ({ < [d Gregorian Full Date]={"$(=Date((today()-1) ,'YYYY-MM-DD'))"}>} [F Sr Sales Quantity])

tnx a lot for your help about date format.

regards

Mana

View solution in original post

11 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

Expression seems OK.

make sure you have proper date format.

Data(today()-1) will return you your system format date which is set in your script background.

Regards

ASHFAQ

Not applicable
Author

  [d Gregorian Full Date] is also set as date format in sql. i don't know what the problem is with my conditional part of the code.

ashfaq_haseeb
Champion III
Champion III

Your Code is fine

Make sure you drop date list box to front end.

and in new text box write =date(today()).

Check what are the date format are they similar.

If possible post a sample data.

Regards

ASHFAQ

Not applicable
Author

as you see there is no problem with the format because they can be added to each other. there should be some problem with the syntax of condition: [d Gregorian Full Date]={"$(=Date(today()-1))"}

Untitled.png

Not applicable
Author

Your script code is correct,may be both date field means your system date field format for today is different from the

[d Gregorian Full Date] date field format. Try to change the date format which is different.

for eg: lets suppose date format of [d Gregorian Full Date] is DD-MM-YYYY and date format of Today() is DD/MM/YYYY

then you should use following code

Sum ({ < [d Gregorian Full Date]={"$(=Date(today()-1,'DD-MM-YYYY'))"}>} [F Sr Sales Quantity])

hope this will help you.

if you still have any issue then post your sample app.

Regards

Bhawna

Not applicable
Author

You should use following code

Sum ({ < [d Gregorian Full Date]={"$(=Date(today()-1,'YYYY-MM-DD'))"}>} [F Sr Sales Quantity])

ashfaq_haseeb
Champion III
Champion III

Hi,

As I say there is format issue.

Try below

=Sum ({ < [d Gregorian Full Date]={"$(=Date(today()-1,'YYYY-MM-DD'))"}>} [F Sr Sales Quantity])

Regards

ASHFAQ

Not applicable
Author

it doesn't work yet

Not applicable
Author

it doesn't work yet