Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Aspiring_Developer
Specialist
Specialist

weekstart numbers qliksense

Hello All,

I have below table :-

Aspiring_Developer_1-1649678192510.png

 

I wish to show the sum of value corresponding to week opening of each month. 

I created week opening dates from Report Date in the above table.

Now , I wish to show only 79 corresponding to 10/04/20222. in the measure .

Right now when I am trying to show , it is prompting me total values of all the days present inside that week like below :-

Aspiring_Developer_2-1649678282829.png

I think , it can be achieved via set analysis but I am not able to understand how ?

Can anyone please help ?

Thanks in advance

@Kushal_Chawda 

 

Labels (4)
1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

So, the main question for me is: Do you want to group by week start, or do you want to filter on week start?

If "group by", then

  • Each week start should show the aggregate of the entire week.
  • Your weekstart dimension should be "=WeekStart(REPORT_DATE)". And it would be better to have it in the script.
  • You need to remove the REPORT_DATE from the dimensions. (Because each week contains multiple dates.) So, just two dimensions: LOB_trend and WeekStart.
  • Optionally, you could use use REPORT_DATE as the the third dimension in a pivot table, and collapse this to get the week aggregate.

If "filter", then

  • Each week start should show the aggregate of the week start day only.
  • Don't use week start as dimension. Use REPORT_DATE.
  • Define week day in the script: WeekDay(REPORT_DATE) as WeekDay
  • Use set analysis: Sum({<WeekDay={Mon}>} TREND_VOL) 

View solution in original post

5 Replies
hic
Former Employee
Former Employee

If you want to show the Sum() for the entire week on the weekstart, you should simply remove the REPORT_DATE from the dimensions. But keep the "LOB_trend" and add "=WeekStart(REPORT_DATE)" as dimension. 

Aspiring_Developer
Specialist
Specialist
Author

Thank you @hic  for your response. However I need to show the report date in my table. And if you will see in the above screenshot , I have created a dimension comprising only weekstart dates of each month. But those dates are showing cumulative sum of all the days in a week instead of single opening date. Please help 

hic
Former Employee
Former Employee

So, the main question for me is: Do you want to group by week start, or do you want to filter on week start?

If "group by", then

  • Each week start should show the aggregate of the entire week.
  • Your weekstart dimension should be "=WeekStart(REPORT_DATE)". And it would be better to have it in the script.
  • You need to remove the REPORT_DATE from the dimensions. (Because each week contains multiple dates.) So, just two dimensions: LOB_trend and WeekStart.
  • Optionally, you could use use REPORT_DATE as the the third dimension in a pivot table, and collapse this to get the week aggregate.

If "filter", then

  • Each week start should show the aggregate of the week start day only.
  • Don't use week start as dimension. Use REPORT_DATE.
  • Define week day in the script: WeekDay(REPORT_DATE) as WeekDay
  • Use set analysis: Sum({<WeekDay={Mon}>} TREND_VOL) 
Aspiring_Developer
Specialist
Specialist
Author

I tried by removing Report date from dimension but it is still giving me the cumulative sum :-

Aspiring_Developer_0-1649750302074.png

 

MayilVahanan
MVP
MVP

Hi @Aspiring_Developer 

MayilVahanan_0-1649752115809.png

Weekstart for all those dates is "4th Apr". so its give cumulative values - 493.
If you want to see only sunday date, then u can include set analysis something like below.

Dim: REPORT_DATE

Exp: Sum({<WeekDay={'Sun'}>} TREND_VOL) 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.