Skip to main content
Announcements
April 9th: The AI Roadmap: 6 Landmarks for AI-ready Data and Analytics: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
magdalenatudose
Creator

Last week_in Qlik Sense

Hi,

I want to see (a KPI) value from last week, without to select last week, staying in selection from this week.

What function or if condition can I put?

I have in my sheet: years, months and dates from months.

Thank you,

Magdalena

Magdalena
25 Replies
ahaahaaha
Partner - Master

Try using function Only(). If it does not work out, can I see a small piece of data?

magdalenatudose
Creator
Author

Hi Andrey,

It doesn't work.

Can you tell me how I can attash the app?

Thank you,

Magdalena

Magdalena
antonaks
Creator II

I think it's convenient and correct to use the label from the calendar.
A label can be used in "Set Analisys".
I am attaching an example of a calendar.
You will be interested in the field label - PW_F and PW_TD

if(InWeekToDate(ID_DATE,'$(DateNow)',-1),1,0) as PW_TD, //Flag of the previous week

if(InWeek(ID_DATE,'$(DateNow)',-1),1,0) as PW_F, //Full previous week flag

magdalenatudose
Creator
Author

Hi Anton, Thank you. Can you attach the app again? The sheet is empty. Thank you, Magdalena

Magdalena
Not applicable

Try this

sum({<Date={"$(=date(max(Date)-7,'MM/DD/YYYY'))"}>}Value)

magdalenatudose
Creator
Author

Hi Thirumal, Thank you, But is not working.. The result is 0, not the number from last week. I don't want to make the sum, i want to show the number (7.09) from the last week. Magdalena

Magdalena
antonaks
Creator II

Ok. I had add new doc.

Please try this

antonaks
Creator II

Also I add script in *.txt

pathiqvd
Creator III

Hi,

Try This,

Write Logic in script for year and week day

year(Datefield) as Year,

     Week(Datefield) as wkday

After Front end write this one:-

Current:- =only({<Year={"$(=MAX(Year))"},wkday={"$(=max(wkday))"}>}Value)

Prev:- =only({<Year={"$(=MAX(Year))"},wkday={"$(=max(wkday)-1)"}>}Value)

Year and wkday fields take as filter.


Regards,

magdalenatudose
Creator
Author

Hi lakshmipathi, Thank you!! It works, but only if I select both week, in the same time. Do you know what i do to appear the both value, when I select just current week? Thank you, Magdalena

Magdalena