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

month start giving wrong value

hi i am trying to get month from from month field

TBAL_Month ={">=$(=MonthStart(max(TBAL_Month)))<=$(=max(TBAL_Month))

result is

MonthStart(max(TBAL_Month)))=1/1/1900


but tabl_month contain jan feb mar .... dec


am i doing anything wrong here


plz give me some solutions


thanks

12 Replies
tresesco
MVP
MVP

Possibly, your TBAL_Month field is not a proper date field. Date creation at the script might be an issue.

arulsettu
Master III
Master III
Author

Hi Tresesco,

TBAL_CAL_MONTH it contain 0,1,2,3,4,5,6,7,8,9,10,11,12

to avoid 0 below code used

                    Month(date#(TBAL_CAL_MONTH,'MM')) as TBAL_Month

now i am trying to create opening balance. if i select month June i need to calculate previous months like may,apr,mar,feb,jan and that 0 as opening balance for june.

i tried this but not getting the correct value

sum({<TBAL_Month ={">=$(=MonthStart(max(TBAL_Month)))<=$(=max(TBAL_Month))"},TBAL_CAL_YEAR={'>=$(Acnt_year)'}>}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)

please help me

prieper
Master II
Master II

Is the above meant to be a variable? Then it can contain only one value for the month.

If meant to be an expression, you are missing aggregation (and curly brackets etc)

Peter

Not applicable

Hi,

    What u wrote in expression that is correct only Monthstart it will give first day of the that particular month

  That is why your getting 1/1/1900 this output

can u explain what u are looking for

Thanks

Manju

arulsettu
Master III
Master III
Author

hi

max(TBAL_Month) is not a variable


thanks


i will upload the sample file

tresesco
MVP
MVP

Well, so you are not bothered about the date. All you need is month. In that case, to get month, try like:

Month(MonthStart(max(TBAL_Month))))

arulsettu
Master III
Master III
Author

thanks Tresesco getting jan month. but not able to get the exact result can you  please check below app

thanks

arulsettu
Master III
Master III
Author

i am trying to create opening balance. if i select month June i need to calculate previous months like may,apr,mar,feb,jan and that 0 as opening balance for june.

arulsettu
Master III
Master III
Author

any help guys?