Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
shabarish0587
Contributor
Contributor

How to display Weekly data when selecting MonthYear in qlikview

Hi Friends,

              I am facing a issue to display  WeekEnd data when selecting MonthYear. When i am using hard coding at data base i am getting correct values. Same thing i am trying to using at expression. I am not getting right value.

Here WEEKEND is Saturday.

I have created a condition in Database like this.

where MonthYear='2018-10'

and ((End_Date is Null and Start_Date <= '2018-10-20') or (End_Date > '2018-10-20' and Start_Date <='2018-10-20'))

the above condition is showing the data for third week end Saturday for 2018-10, i am getting total value is 228 for above condition. When i am taking hard-coding for each week values are coming fine. Same thing i need to take instead of hard-coding. When i am taking instead of hard-coding i am getting values for entire month i.e 188, but specific weekend the values are not correct. Can any one help me on this. Thanks in Advance

 

4 Replies
ashok_rajm
Contributor III
Contributor III

Hi,

There are multiple approach for this requirement: 

Creating a Flag in Back-end for weekend dates and use that flag in Set analysis - Sum({< WeekEnd_Flag = {1}>} Values)

or

Calculate Start and end date in Variable and use those variable in Set analysis, But make sure Field Value format and Variable Value format are same -

Sum({<End_Date ={'> $(vEnd_Date)'}, Start_Date  ={'<=$(vStart_Date)'}>} Values)

Hope this helps

eddiesantos
Contributor
Contributor

Hi @shabarish0587 

I am not sure if I understood your question. 

Have you tried the function weekday()?

Try to use this function in your logic as it will return you Saturday and Sunday as 5,6 respectively. This will allow you to restrict your calculation if that is the case.

Cheers

Eddie

shabarish0587
Contributor
Contributor
Author

Hi Ashok,

 

       Can you please show me the examples if you have. Thanks in advance 

ashok_rajm
Contributor III
Contributor III

Can you help me with sample data  and what is the result you are looking for..