Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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
karthikeyan1504
Creator III
Creator III

Hi,

Try to restrict the 31 days from Dimension Limits option from bar chart properties.

Choose show only first 31 days, and sort the dimension in descending order.

Warm Regards,

Karthikeyan.

sasiparupudi1
Master III
Master III

Please post your application with sample data

kavita25
Partner - Specialist
Partner - Specialist

Your date format is wrong.

As in the screenshot ur date format is DD/MM/YYYY

So try using this:

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


Hope it helps you!!

Anonymous
Not applicable
Author

Hi Jagan,

As u suggested i modified the script and it  is displaying data. But i am still seeing all data. But it is not restricting to 31 days.

jagan
Luminary Alumni
Luminary Alumni

If you attach the sample file then it would easier to help you.

Regards,

Jagan.

qlikviewwizard
Master II
Master II

PPlease attach sample file.‌

Not applicable
Author

Hi Kumar, you can use couple of approaches for this requirement.

1. SET Analysis

    As per discussion, you have time stamp nn your date field. so please remove the time with floor function.

      Floor(DateTimeField) AS DateField --> QV generate number from this function & you can convert the number into date.

    Count( {<DateField={">=$(=Max(DateField)-31)"}>} DISTINCT VisitorID)

Note: the Max function also return number format & you need to explicitly convert number format into your data format if date field not in the number format.

2. Dimension Limits

     First on sort tab you need to sort the data based on your date dimension desc order. In the dimension limits tab Select check box for Restrict which values are displayed using the first expression. and show only first 31 values. the down side of this approach if some one change the sort order on UI it will change.

Anonymous
Not applicable
Author

hi,

I am attaching qvd and model. Can anyone help me how to get it back only 31 days data only.

Thanks,

Kumar

jagan
Luminary Alumni
Luminary Alumni

Hi Kumar,

There is no matching records between the dim_visitor and dim_time tables, I think there is an issue with the key

field site_visit_start_datetime_key, check it in the script which is generating the QVD.


Hope this helps you..


Regards,

Jagan.