Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

QSense
Contributor II

expression based on a Date Field

Hello ,

My below expression is based on today -30

but I want to based it on my dimension  =date(WeekStart(ISTEK_ACISTARIHI2),'DD.MM.YYYY')

İn shortly my dimension - 30 all ı want

=Count({<ISTEK_ACISTARIHI2 = {"<=$(=Timestamp(Today() - 30, 'DD.MM.YYYY hh:mm:ss'))"},ISTEK_DURUM={'Açik'}>} ISTEK_ACISTARIHI2)

8 Replies
Not applicable

Re: expression based on a Date Field

Hi

if ur field is timestamp format then use

timestamp(timestamp#(urdimension)-30)

it is first convert timestamp filed into numbers and substract with 30 then

it convert it in to timestamp format

=Count({<ISTEK_ACISTARIHI2 = {"<=$(=timestamp(timestamp#(urdimension)-30), 'DD.MM.YYYY hh:mm:ss'))"},ISTEK_DURUM={'Açik'}>} ISTEK_ACISTARIHI2)


QSense
Contributor II

Re: expression based on a Date Field

Unfortunately it didnt work

Not applicable

Re: expression based on a Date Field

Hi

what is this

ISTEK_ACISTARIHI2 format  give some  values for this

QSense
Contributor II

Re: expression based on a Date Field

Exactly What do you mean?

Not applicable

Re: expression based on a Date Field

Hi

it has another solution

i create one variable with expr like 

vdays

=Timestamp(Timestamp#(PERIOD_END_DATE)-30)

and in expression

Sum({<PERIOD_END_DATE={">=$(vdays)"}>}CR_AMOUNT)

it works for me

for u use the below expr

Sum({<ISTEK_ACISTARIHI2={">=$(vdays)"},ISTEK_DURUM={'Açik'}>}metric)

QSense
Contributor II

Re: expression based on a Date Field

Where did you create variable in script side or in where

QSense
Contributor II

Re: expression based on a Date Field

I created variable but it does not satisfy date condition

for example 01.01.2012 selected ıt must get 30 days before data from this date but

it does not work in this way

Not applicable

Re: expression based on a Date Field

use date() insted of timestamp()

date#() instead of timestamp#()

in th above exp

create variable in settings-variable overview

vdays

=date(date#(PERIOD_END_DATE)-30)

Sum({<ISTEK_ACISTARIHI2={">=$(vdays)"},ISTEK_DURUM={'Açik'}>}metric)

ur field in date format

my exp in timestamp format

it work for me


Community Browser