Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can anyone help me to write this statement in Qlikview
Sample Data:
WEEK COUNT
1 75000
2 39000
3 4000
4 2600
5 1400
6 900
7 300
8 68
9 2
10 1
11 100
12 5
SO I NEED TO CREATE A BUCKET...!
REQUIRED OUTPUT
WEEK COUNT
1 75000
2 39000
3-12 9376 (which is sum of all the other weeks except 1,2)
SQL CODE: TO GET THE ABOVE SAID OUTPUT
CASE
WHEN WEEK IN (1,2) THEN
COUNT(WEEK) /WEEK
ELSE SUM(WEEK) END AS COULMN_NAME
IS THERE A WAY TO RESOLVE THIS ISSUE...??
THANKS IN ADVANCE..
Dimension
LOAD Week,
Count,
If(WEEK > 3, Dual('3-12', 3), WEEK) as Bucket
FROM ....
and not use Bucket as dimension and Sum(Count) as Expression
Dimension ->week
Expression->if(WEEK=1 ,Sum (COUNT),if(WEEK=2 ,Sum (COUNT),Sum({<WEEK-={1,2}>}total COUNT)))
Thank You
WEEK -={1,2}
Can u try by making above expression variable?
If(WEEK > 3, Dual('3-12', 3), WEEK) as Bucket
What is the use of Dual over here?