Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Please, help! I can't select and subtract days from max(date)

Hello, please I would like some help with a problem using qlik sense.

I need to limit the data in a graphic to the last 14 days. I am trying to use the following expression in the dimension field:

=IF(DATE(CRESCIMENTO_BANCO_COMPLETO.DATA)>=DATE(MAX(CRESCIMENTO_BANCO_COMPLETO.DATA)-14),CRESCIMENTO_BANCO_COMPLETO.DATA)

If I use just

=CRESCIMENTO_BANCO_COMPLETO.DATA

The graphic plots ok, but with all data.

Thank you very much!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Thank you Sunny and Gabriel, but I used another way and solved the problem:

In dimension fiel I used: =Date([CRESCIMENTO_BANCO_COMPLETO.DATA])

And in measure field I used:

IF(Rank([CRESCIMENTO_BANCO_COMPLETO.DATA]) <= 10,

Sum([CRESCIMENTO_BANCO_COMPLETO.TAMANHO])/1024

)

And now works well.

View solution in original post

5 Replies
sunny_talwar

Try this

=If(CRESCIMENTO_BANCO_COMPLETO.DATA >= Max(TOTAL CRESCIMENTO_BANCO_COMPLETO.DATA) - 14), CRESCIMENTO_BANCO_COMPLETO.DATA)

Anonymous
Not applicable
Author

Hi, Sunny Talwar, thanks but did not work. I have the warning: invalid dimension.

When I use the bellow expression in the kpi object, just to try, it works fine, showing the correct date:

DATE(MAX(CRESCIMENTO_BANCO_COMPLETO.DATA)-14)

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

May be try to convert the date to number like

IF(NUM(CRESCIMENTO_BANCO_COMPLETO.DATA)>=

NUM((MAX(CRESCIMENTO_BANCO_COMPLETO.DATA))-14),

CRESCIMENTO_BANCO_COMPLETO.DATA)

Hope it works

sunny_talwar

My bad, try this

=If(CRESCIMENTO_BANCO_COMPLETO.DATA >= Max(TOTALCRESCIMENTO_BANCO_COMPLETO.DATA) - 14, CRESCIMENTO_BANCO_COMPLETO.DATA)

Anonymous
Not applicable
Author

Thank you Sunny and Gabriel, but I used another way and solved the problem:

In dimension fiel I used: =Date([CRESCIMENTO_BANCO_COMPLETO.DATA])

And in measure field I used:

IF(Rank([CRESCIMENTO_BANCO_COMPLETO.DATA]) <= 10,

Sum([CRESCIMENTO_BANCO_COMPLETO.TAMANHO])/1024

)

And now works well.