Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

Hi Ariel,

Can you post a sample QVW?

jepeerik
Contributor III
Contributor III

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
Anonymous
Not applicable
Author

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
Specialist
Specialist

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,

maxgro
MVP
MVP

PFA

1.png

Not applicable
Author

Thanks for the post MaxGro.

Not applicable
Author

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

jagan
Luminary Alumni
Luminary Alumni

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
Author

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