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

Qlik calculation not working

Hi,

The following calculation does not seem to work:

Sum({$<DATE={'$(=date(MAX(DATE)))'}>} Sales)

This has however worked in the past but am not sure whats wrong now.

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi,

I have attached working qvw file.

=Sum({$<[Run Date]={'$(=date(max([Run Date]),'MM/DD/YYYY'))'}>} COUNT_PASS)

Regards

ASHFAQ

View solution in original post

18 Replies
ecolomer
Master II
Master II

is possible that the format of DATE is wrong?

ashfaq_haseeb
Champion III
Champion III

Hi,

Make sure you have proper masking.

Qlik is case sensitive.

Or post sample app to review.

Regards

ASHFAQ

Not applicable
Author

Hi,

Try With giving Date format

jagan
Luminary Alumni
Luminary Alumni

Hi,

I think the issues is because of date format, the date format in DATE and Qlikview date format is different, to make sure check like this

Date(MAX(DATE)) and DATE field format are not same, you have to change the format by using


Date(DateFieldName, Format)


Example : Date(MAX(DATE), 'DD-MMM-YYYY')


Or simply when you are loading data transform the date like below


Data:

LOAD

*

Date(DATE) AS FormattedDate

FROM Source;


Now use this expression


Sum({$<FormattedDate={'$(=date(MAX(FormattedDate)))'}>} Sales)


Hope this helps you.


Regards,

Jagan.

Not applicable
Author

Enrique,

I had issues with dates as I had to extract data from database to flat files because of connection issues but that's a different story. The file extract produced the dates in 'MM/DD/YYYY'

I had handled this in the script to convert it to date using:

Date#( [File Date], 'MM/DD/YYYY')

My requirement was to display dates in international format hence I have also formatted the date:

Date(Date#( [File Date], 'MM/DD/YYYY'), 'YYYY-MM-DD')

Do you think this is causing issues?

Not applicable
Author

Jagan,

I have tried this but that doesn't seem to help

ashfaq_haseeb
Champion III
Champion III

Hi,

Can you share your sample.

Regards

ASHFAQ

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

That looks correct, but format the Max date in the same way:

Sum({$<DATE={'$(=Date(Max(DATE), 'YYYY-MM-DD'))'}>} Sales)


HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
aveeeeeee7en
Specialist III
Specialist III

Try this:

Sum({$<DATE={'$(=MAX(DATE))'}>} Sales)

I thinks it's the Format Issue.

Regards

Aviral Nag