Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

kumarreddy257
Contributor

Display last 31 days data

Hello experts,

I have chart in that one date dimension and multiple expressions are there. I want to display last 31 days from max of date.

Can any one suggest me how to do that one.

Regards,

Kumar

28 Replies
lironbaram
Honored Contributor II

Re: Display last 31 days data

in yout expressions

use this set analysis

sum({<Date={"$(=max(Date)-30)"}>} Sales)

use the same set analysis on all expressions

qlikviewnovice
Valued Contributor II

Re: Display last 31 days data

Hi,

Try this:

Sum({<Year=, Quarter=, Month=, Week=, Date={‘>=$(=Date(Today()-30))<=$(=Today())’}>} Your expression )

kumarreddy257
Contributor

Re: Display last 31 days data

Hi,

I have expression like this

=count(DISTINCT{$<[Site Visit Hit Source]={"<>5,7,8,9"}, [Site Visit Post Page Event] = {0}>} [Visitor ID])

can you guide me how to include this one in that particular expression.

Regards,

Kumar

qlikviewnovice
Valued Contributor II

Re: Display last 31 days data

Sum({<Year=, Quarter=, Month=, Week=, Date={"$(=max(Date)-30)"}>} Sales)

MVP
MVP

Re: Display last 31 days data

if the date field is Date

=count(DISTINCT{$<[Site Visit Hit Source]={"<>5,7,8,9"}, [Site Visit Post Page Event] = {0}, Date={"$(=max(Date)-30)"}>} [Visitor ID])


or

=count(DISTINCT{$<[Site Visit Hit Source]={"<>5,7,8,9"}, [Site Visit Post Page Event] = {0}, Date={"$(=date(max(Date)-30))"}>} [Visitor ID])


kumarreddy257
Contributor

Re: Display last 31 days data

I have written same logic, but it is displaying more than 31 days data.

Pls screen the screen shot.

In above date max date is 21/02/2015, but I am seeing even 2014 data also. Could you help me on this issue

Regards,

Kumar.

MVP
MVP

Re: Display last 31 days data

could you post your Qlik doc or an extract?

or if you can't

start simple

=count(DISTINCT{$<Date={"$(=date(max(Date)-30))"}>} [Visitor ID])

remove the label Unique Visitors, go with the mouse on the blank label, capture the expression (image) and post

EDIT

this is not correct

[Site Visit Hit Source]={"<>5,7,8,9"}


replace with

[Site Visit Hit Source]=-{5,7,8,9}

kumarreddy257
Contributor

Re: Display last 31 days data

Hi,

=count(DISTINCT{$<[Site Visit Hit Source]={"<>5,7,8,9"}, [Site Visit Post Page Event] = {0},[Time Full Date]={"$(=max(Date([Time Full Date],'MM/DD/YYYY'))-30)"}>} [Visitor ID])

There was mistake in that, instead of [Time Full Date] i took date only.

After including this [Time Full Date]={"$(=max(Date([Time Full Date],'MM/DD/YYYY'))-30)" one in set analysis it is giving 0's. I don't know why it is happening. It should give last 31 days data?

Regards,

Kumar

Arjunarao
Honored Contributor II

Re: Display last 31 days data

HI kumarreddy257

Did you resolve the issue? Thank You.

Community Browser