Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
waleeed_mahmood
Creator
Creator

Divide the number into equal periods

hello all,

is there a way to do this in Qlik? 

C51EE68D-E36E-453B-90C9-6C630618DEAE.png

In words, I want to divide the amount into 3 equal parts and assign periods based on the Quarters. So for example, the 3rd last row is divided into 3 equal parts and assigned period 10,11,12. 
Q1: 1,2,3

Q2: 4,5,6

Q3: 7,8,9

Q4: 10,11,12

please let me know if you have any questions.

thanks,

waleed

Labels (2)
1 Solution

Accepted Solutions
Taoufiq_Zarra

@waleeed_mahmood 

several option, for example :

Data:
LOAD * INLINE [
    BU, KPI, Amount, Qtr
    a, s, 120, 1
    z, d, 150, 1
    e, f, 140, 3
    r, c, 160, 4
    t, r, 1500, 4
];
left join 
load * inline [
Period,Qtr
1,1
2,1
3,1
4,2
5,2
6,2
7,3
8,3
9,3
10,4
11,4
12,4
];

output:

load *, Num(Amount/3,'# ##0,0') as New_Amount resident Data;

drop table Data;

 

input table :

Capture.JPG

output table :

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

1 Reply
Taoufiq_Zarra

@waleeed_mahmood 

several option, for example :

Data:
LOAD * INLINE [
    BU, KPI, Amount, Qtr
    a, s, 120, 1
    z, d, 150, 1
    e, f, 140, 3
    r, c, 160, 4
    t, r, 1500, 4
];
left join 
load * inline [
Period,Qtr
1,1
2,1
3,1
4,2
5,2
6,2
7,3
8,3
9,3
10,4
11,4
12,4
];

output:

load *, Num(Amount/3,'# ##0,0') as New_Amount resident Data;

drop table Data;

 

input table :

Capture.JPG

output table :

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉