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

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
maxgro
MVP
MVP



count( {$<

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

          [Site Visit Post Page Event] = {0},

          [Time Full Date]={">=$(=date(max([Time Full Date])-30, 'MM/DD/YYYY'))"}

     >} DISTINCT [Visitor ID])


the order of the function is important


max([Time Full Date])                                                  this is a num

max([Time Full Date])-30                                            this is a num

date(max([Time Full Date])-30, 'MM/DD/YYYY')       this is a MM/DD/YYYY

and if [Time Full Date] is a MM/DD/YYYY it should be ok



Anonymous
Not applicable
Author

No, still i am struggling with this issue.

sasiparupudi1
Master III
Master III

what is the format of the value in [Time Full Date] ?

and if you put date(max([Time Full Date])-30, 'MM/DD/YYYY') in a text box, do you get the date in the format that matched to Time Full Date?

ganeshreddy
Creator III
Creator III

Hi Kumar,

Try this it gives you last month count from today.

count(if(Time Full Date >= AddMonths(today(),-1),[Visitor ID])) as Last_ Month_VisitorID_Count,

Cheers,

Ganesh

Anonymous
Not applicable
Author

Hi Ganesh,

I should not take today(), because based on the data load I have to take it.

Regards,

Kumar

Anonymous
Not applicable
Author

I got date. Some where it is going wrong. I am new to qlikview and can't figure out exactly.

Anonymous
Not applicable
Author

[Time Full Date ] is time stamp.

maxgro
MVP
MVP

try with a date

to get a date from timestamp, in script you can add a field

.....

date(floor([Time Full Date])) as [Full Date]

.....

qlikviewwizard
Master II
Master II

Can you attach the sample data to demonstrate your issue. It will help the folks to give correct answer instead of guessing answers. Thank you.

jagan
Luminary Alumni
Luminary Alumni

Hi,

I think the issue is the Date format in your set analysis expression, in script change like below

LOAD

*,

Date(Floor(DateFieldName)) AS DateOnly

FROM DataSource;

Now use below expression

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

          [Site Visit Post Page Event] = {0},

          DateOnly={">=$(=Date(Max([DateOnly])-30))<=$(=Date(Max(DateOnly)))"}

     >} DISTINCT [Visitor ID])


Hope this helps you.

Regards,

Jagan.