Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sspawar88
Creator II
Creator II

Last 48 Hours Data in dashboard

How We can take last 48 hours data in dashboard?

How can we do it in Script?

Load

    date(txn_time,'DD-MM-YYYY') as "Date",

    timestamp(txn_time,'DD-MM-YYYY hh:mm:ss') as "Timestamp",

    "txn_time"

FROM [lib://QVD/Data.QVD]

(qvd);

Can i do it on Dashboard?

suppose i have pie chart and Expression is:

Count({$<param_name={'TEMP'},param_value={'<=-20'},loc_subtype-={'2'},branch_type={'FACTORY'}>}param_value)/

Count({$<param_name={'TEMP'},branch_type={'FACTORY'},loc_subtype-={'2'}>}param_value)

can we do directly in this expression around "txn_time" ? how?

1 Solution

Accepted Solutions
sunny_talwar

Try this may be:

Load

    date(txn_time,'DD-MM-YYYY') as "Date",

    timestamp(txn_time,'DD-MM-YYYY hh:mm:ss') as "Timestamp",

    "txn_time"

FROM [lib://QVD/Data.QVD]

(qvd)

Where TimeStamp(txn_time,'DD-MM-YYYY hh:mm:ss') >= Timestamp(Now() - 2, 'DD-MM-YYYY hh:mm:ss');

View solution in original post

4 Replies
sunny_talwar

Try this may be:

Load

    date(txn_time,'DD-MM-YYYY') as "Date",

    timestamp(txn_time,'DD-MM-YYYY hh:mm:ss') as "Timestamp",

    "txn_time"

FROM [lib://QVD/Data.QVD]

(qvd)

Where TimeStamp(txn_time,'DD-MM-YYYY hh:mm:ss') >= Timestamp(Now() - 2, 'DD-MM-YYYY hh:mm:ss');

sunny_talwar

May be this in your set analysis for the expression:

{<Timestamp = {"$(='>=' & TimeStamp(Max(Timestamp) - 2, 'DD-MM-YYYY hh:mm:ss') & '<=' & TimeStamp(Max(Timestamp), 'DD-MM-YYYY hh:mm:ss'))"}>}

maxgro
MVP
MVP

Load

    date(txn_time,'DD-MM-YYYY') as "Date",

    timestamp(txn_time,'DD-MM-YYYY hh:mm:ss') as "Timestamp",

    "txn_time"

FROM [lib://QVD/Data.QVD] (qvd)

where

  Timestamp#(Timestamp, 'DD-MM-YYYY hh:mm:ss') <= now()

  and

  Timestamp#(Timestamp, 'DD-MM-YYYY hh:mm:ss') >= (now()-2)

   ;

qlikviewwizard
Master II
Master II

Hi Please use the below script:

Thank You.

Capture.JPG

Data:

Load

    date(txn_time,'DD-MM-YYYY') as Date,

    timestamp(txn_time,'DD-MM-YYYY hh:mm:ss') as Timestamp,

    txn_time

FROM [lib://QVD/Data.QVD] (qvd)

where

  Timestamp#(Timestamp, 'DD-MM-YYYY hh:mm:ss') <= now() and Timestamp#(Timestamp, 'DD-MM-YYYY hh:mm:ss') >= (now()-2) ;