Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Highlighted
Not applicable

How to: Recent seven days by the selected day

I need to show last seven days according to the selected day.

how to do it?

Thanks

17 Replies
Not applicable

Re: How to: Recent seven days by the selected day

Hi Ariel,

Can you post a sample QVW?

jepeerik
New Contributor III

Re: How to: Recent seven days by the selected day

Take a look at this thread.

Set analysis sum between two given dates

There you'll find this Set Analysis example:

= sum({<OrderDate= {">=$(=min(StartDate))<=$(=max(EndDate))"}> } Netamountpaid)


If you change 'min(StartDate)' with 'max(EndDate)-7' you'll have a Set Analysis with a date range of 7 days. If you adjust the EndDate field with your own date-field (and off course the correct SUM field), then you'll have your 7 days according to your selection.

Sharing knowledge increases your knowledge

Re: How to: Recent seven days by the selected day

Maybe something like this :

     sum({<date={">=$(=AddMonths(Max(date-6),0))<=$(=Max(date))"}>} Value).

I have pasted that from rolling seven days Set analysis a which a Google Search for "QlikView set analysis previous 7 days" found

santiago_respane
Valued Contributor

Re: How to: Recent seven days by the selected day

Hi Ariel,

There are a lot of ways to achieve that, it depends on what you need to do.

If you need a sum of values you can use set analysis:

=sum({<[Date field]={">=$(=v.SelectedValueMinusSeven)<=$(=v.SelectedValue)"}>} [Amount])

if you need to show dimention maybe using calculated dimension.

It would be great if you can share som data or elaborate more in order to help you finding the solution.

Kind regards,

MVP
MVP

Re: How to: Recent seven days by the selected day

PFA

1.png

Not applicable

Re: How to: Recent seven days by the selected day

Thanks for the post MaxGro.

Not applicable

Re: How to: Recent seven days by the selected day

Hi,

Thanks for your help.

I think i need calculate dimension, i want to create fit X(date) by Y(sum) and control on the x-axis.

QV.PNG

Thanks

Ariel

MVP & Luminary
MVP & Luminary

Re: How to: Recent seven days by the selected day

Hi,

Try this expression

Sum({<Year=, Quarter=, Month=, Week=, Date={‘>=$(=Date(Max(Date)-6))<=$(=Date(Max(Date)))’}>} Sales )


Check this link for similar expressions for various scenarios


Set Analysis for Rolling Periods


Regards,

jagan.

Not applicable

Re: How to: Recent seven days by the selected day

Hi,

thanks.

Not understand the syntax. i have 2 column, sDate and sMoney and i want to create fit x(sDate) by y(sMoney).

Thanks

Ariel