Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
arulsettu
Master III
Master III

Calculate opening balance

Hi,

     I am trying to show opening balance. i am having month field

TBAL_CAL_MONTH

0

1

2

3

4

5

6

7

8

9

10

11

12

if i select 7th month it should show the value of 0-6 th month as opening balance

i tried below code but no luck

sum({<TBAL_CAL_MONTH={">=$(=MonthsStart(Date(Max(TBAL_CAL_MONTH))))<=$(=Max(Date(TBAL_CAL_MONTH)))"}>}TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1)

plz suggest

thanks

27 Replies
simsondevadoss
Partner - Creator III
Partner - Creator III

Use this :

sum({<TBAL_Month={'<=$(vTBL_month)'}>}TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1)

simsondevadoss
Partner - Creator III
Partner - Creator III

Also change the variable to vTBL_month=max(TBAL_Month)-1

arulsettu
Master III
Master III
Author

Hi

please check this app i selected some fields.the results are not correct

expected is

Cash and cash equivalents                                                      

1.7157E+09    

                                                                               

Assets                                                                         

Insurance and other receivables                                                

-8.618E+08     

                                                                               

Assets                                                                         

Investments                                                           

4.5878E+09     

                                                                               

Assets                                                                         

Property and equipment                                                         

20462764.6        

thanks

arulsettu
Master III
Master III
Author

check

arulsettu
Master III
Master III
Author

does any one have idea about this its emergency plz suggest

sagarkharpude
Creator III
Creator III

try this

sum({<TBAL_Month={'<$(=Max(TBAL_Month)-1)'}>}TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1)

arulsettu
Master III
Master III
Author

Actually what i need is if i select jun month it should give calculate may,apr,mar,feb,jan  values as opening balance of june  

this is the expected output

Cash and cash equivalents                                                     

1.7157E+09   

                                                                              

Assets                                                                        

Insurance and other receivables                                               

-8.618E+08    

                                                                              

Assets                                                                        

Investments                                                          

4.5878E+09    

                                                                              

Assets                                                                        

Property and equipment                                                        

20462764.6       

if i select these filters i should get above result

TBAL_CAL_YEAR=2014

AND TBAL_COMP_CODE='001'

tbal_month= jun

thanks

arulsettu
Master III
Master III
Author

this is the expression i used

=Sum( {$<TBAL_Month={">=$(=MonthStart(AddMonths(Max(TBAL_Month),-13)))<$(=MonthEnd(Max(TBAL_Month)))"}>}TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1)+sum({<ACNT_FLEX_02={'Balance Sheet'}>}TBAL_MTD_DR_LC_1)-sum({<ACNT_FLEX_02={'Balance Sheet'}>}TBAL_MTD_CR_LC_1)

Not applicable

Your

=sum(TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1)

exp returns 1647111788.9404 & selection of 0-6 month opening balance is -65453344 for same exp

&

your expectation is 1715700000 with filtered data is your measure calculation right ?



arulsettu
Master III
Master III
Author

=sum({<ACNT_FLEX_02={'Balance Sheet'}>}TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1)

above is current balance

to find opening balance i have to calculate previous months balance and add to current balance

this 1715700000 output is current balance + previous months balance


if i select these filters

TBAL_CAL_YEAR=2014

AND TBAL_COMP_CODE='001'

tbal_month= jun

i should get this 1715700000 result for cahs and cash equivalents