Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
QSense
Creator II
Creator 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

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
Creator II
Creator II
Author

Unfortunately it didnt work

Not applicable

Hi

what is this

ISTEK_ACISTARIHI2 format  give some  values for this

QSense
Creator II
Creator II
Author

Exactly What do you mean?

Not applicable

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
Creator II
Creator II
Author

Where did you create variable in script side or in where

QSense
Creator II
Creator II
Author

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

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