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

How to add Quarter as Dimensions & Bifurcation of cumulative balance

HI

I have data similar as below

Month     Amount

Jan          10

Feb          25

Mar          15

Apr          45

May         60

Jun          35

Jul            45

Aug          80

Sep          100

Oct          105

Nov          90

Dec          80

Q1: How I can add Quarter 1 (Jan -Mar) Q2 (Apr-Jun) Q3 and Q4 as Dimensions or in Coding as Fields

Q2: Above balances are cumulative balances, How I can bifurcate these balances as period balances for each month in Coding or in expression as formula to show in chart or table e.g For Feb Balance should be 25-10 = 15 vice versa 

Regards

1 Solution

Accepted Solutions
sunny_talwar

This?

Capture.PNG

Table:

LOAD *,

  Amount - Alt(Previous(Amount), 0) as [Period Balance];

LOAD *,

  'Q' & Ceil(Month/3) as Quarter;

LOAD Month(Date#(Month, 'MMM')) as Month,

  Amount;

LOAD * Inline [

Month,    Amount

Jan,          10

Feb,          25

Mar,          15

Apr,          45

May,        60

Jun,          35

Jul,            45

Aug,          80

Sep,          100

Oct,          105

Nov,          90

Dec,          80

];

View solution in original post

2 Replies
sunny_talwar

Balances can be negative also? Mar - Feb -> 15 - 25 = -10?

sunny_talwar

This?

Capture.PNG

Table:

LOAD *,

  Amount - Alt(Previous(Amount), 0) as [Period Balance];

LOAD *,

  'Q' & Ceil(Month/3) as Quarter;

LOAD Month(Date#(Month, 'MMM')) as Month,

  Amount;

LOAD * Inline [

Month,    Amount

Jan,          10

Feb,          25

Mar,          15

Apr,          45

May,        60

Jun,          35

Jul,            45

Aug,          80

Sep,          100

Oct,          105

Nov,          90

Dec,          80

];