Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
rrodriguesrr
New Contributor III

SET ANALYSIS = Using MAX(DATE) and disregard YEAR, MONTH and DAY Selection

Hi folks,

I have the following scenario:

I'm trying to sum a VALUE considering only the values accumulated in the MAX DATE of my fact table. It's currently working through the expression bellow:

SUM( {$< TYPE_FACT = {'Remove CAP'},  DATE = {'$(=Max(DATE))'} >} VALUE )

However, the expression is currently considering the YEAR, MONTH and DAY selected in order to set the MAX(DATE), but I don't want it to consider those filters.

What can I do in this case?

Cheers,

Rubens Rodrigues

Tags (1)
1 Solution

Accepted Solutions
thiago_mlg
Contributor II

Re: SET ANALYSIS = Using MAX(DATE) and disregard YEAR, MONTH and DAY Selection

Rubens,

The correct is:

SUM( {1< TYPE_FACT = {'Remove CAP'},  DATE = {'$(=Max({1} DATE))'} >} VALUE )


If dont have the first one, no works.


See ya..


Thiago Gonçalo

7 Replies
MVP
MVP

Re: SET ANALYSIS = Using MAX(DATE) and disregard YEAR, MONTH and DAY Selection

SUM( {$<YEAR=, MONTH=, DAY=,  TYPE_FACT = {'Remove CAP'},  DATE = {'$(=Max(DATE))'} >} VALUE )

rrodriguesrr
New Contributor III

Re: SET ANALYSIS = Using MAX(DATE) and disregard YEAR, MONTH and DAY Selection

Hi Manish,

I've tried this script, but when I select Year, Month or Day, the number still changes. I also tried:

SUM( {1<YEAR=, MONTH=, DAY=,  TYPE_FACT = {'Remove CAP'},  DATE = {'$(=Max(DATE))'} >} VALUE )

Thanks,

Rubens

qlikviewnovice
Valued Contributor II

Re: SET ANALYSIS = Using MAX(DATE) and disregard YEAR, MONTH and DAY Selection

Hi Rubens,

Try this expression:

SUM( {$<YEAR=, MONTH=, DAY=,  TYPE_FACT = {'Remove CAP'},  DATE = {'$(=Max(DATE))'} >} VALUE )

MVP
MVP

Re: SET ANALYSIS = Using MAX(DATE) and disregard YEAR, MONTH and DAY Selection

It should not change..
Make sure that all Fields are Case Sensitive...

YEAR, MONTH and DAY is different from Year, Month and Day..

If still not working, provide sample app.

antoniotiman
Honored Contributor III

Re: SET ANALYSIS = Using MAX(DATE) and disregard YEAR, MONTH and DAY Selection

Try

SUM( {$< TYPE_FACT = {'Remove CAP'},  DATE = {'$(=Max({1} DATE))'} >} VALUE )

thiago_mlg
Contributor II

Re: SET ANALYSIS = Using MAX(DATE) and disregard YEAR, MONTH and DAY Selection

Rubens,

The correct is:

SUM( {1< TYPE_FACT = {'Remove CAP'},  DATE = {'$(=Max({1} DATE))'} >} VALUE )


If dont have the first one, no works.


See ya..


Thiago Gonçalo

rrodriguesrr
New Contributor III

Re: SET ANALYSIS = Using MAX(DATE) and disregard YEAR, MONTH and DAY Selection

Thank you Thiago/Antonio,

It was really missing the "1" after "SUM {...".

SUM( {1< TYPE_FACT = {'Remove CAP'},  DATE = {'$(=Max({1} DATE))'} >} VALUE )

It's working properly now.

Thank you guys!

Rubens

Community Browser