Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
CHAY-92
Contributor II
Contributor II

How to get weekly sum

Hi ,

I want display a bar chart with

35 percent of sum of sales (week1 to week 25 )and 

55 percent of sum of  sales (week 26 to week 52 )

Dimension:  week

How to write a measure to achieve this task. Thanks 

Labels (2)
3 Replies
chriscammers
Partner - Specialist
Partner - Specialist

I'm not sure I understand this fully but I'll make some assumptions

First you want 35% Sales from the first half of the year and 55% of sales from the second half .

you want a single measure that does this so you can have a bar chart

The key to what I am demonstrating in this sample is using the search capability in Set Analysis, when you use double quotes "" in your set modifier qlik will search with wildcard characters or inequality comparisons like >=

Single quotes ''would give you an exact value match.

//Range sum is a non aggregate function that adds to calculations together
RangeSum(
   //This is the First Half of the year
   Sum({<Week ={">=1<=26"}>}Sales) * .35
   ,
   //This is the Second Half of the year
   Sum({<Week ={">=27<=52"}>}Sales) * .55
)


If this does not help try to explain your case with a little more detail and we'll see if we can figure it out.

sidhiq91
Specialist II
Specialist II

@CHAY-92  Could you please post some sample data and the expected output that would help us to find the right solution for your question.

CHAY-92
Contributor II
Contributor II
Author

Hi chriscammers,

I will try to implement this formula and  will share if I face any difficulties. THANKS 😊 🙏