Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Re: Re: Qlik calculation not working

Hi,

I have attached working qvw file.

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

Regards

ASHFAQ

18 Replies
ecolomer
Honored Contributor II

Re: Qlik calculation not working

is possible that the format of DATE is wrong?

Re: Qlik calculation not working

Hi,

Make sure you have proper masking.

Qlik is case sensitive.

Or post sample app to review.

Regards

ASHFAQ

Not applicable

Re: Qlik calculation not working

Hi,

Try With giving Date format

MVP
MVP

Re: Qlik calculation not working

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

Re: Qlik calculation not working

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

Re: Qlik calculation not working

Jagan,

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

Re: Qlik calculation not working

Hi,

Can you share your sample.

Regards

ASHFAQ

MVP
MVP

Re: Qlik calculation not working

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
Valued Contributor III

Re: Qlik calculation not working

Try this:

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

I thinks it's the Format Issue.

Regards

Aviral Nag

Community Browser