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

getting wrong value in set analysis

HI,

     to get last six month value i got this code from experts

Sum({$<ACNT_FLEX_02={'Balance Sheet'},datefield={">=$(=date(Addmonths(max(datefield),-6)))<=$(=date(max(datefield)))"}>}TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1)

when implement for example if i select 2014 12th month it show 2014 6th month. up to this correct. but the value for the last six month is same as the current value. there is no difference.

please some one clarify its really emergency...

thanks

18 Replies
sushil353
Master II
Master II

Hi,

Try to separate your expression as

Sum({$<ACNT_FLEX_02={'Balance Sheet'},datefield={">=$(=date(Addmonths(max(datefield),-6)))<=$(=date(max(datefield)))"}>}TBAL_MTD_DR_LC_1) - Sum({$<ACNT_FLEX_02={'Balance Sheet'},datefield={">=$(=date(Addmonths(max(datefield),-6)))<=$(=date(max(datefield)))"}>}TBAL_MTD_CR_LC_1)

HTH

Sushil

Not applicable

hi,

Bypass month,year 

Sum({$<Month=,Year=, ACNT_FLEX_02={'Balance Sheet'},datefield={">=$(=date(Addmonths(max(datefield),-6)))<=$(=date(max(datefield)))"}>}TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1)



Regards

Vimlesh

Not applicable

Hi,

Check this app.

Regards

Vimlesh

arulsettu
Master III
Master III
Author

sorry for the confusion

my requirement is i have month field like this

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

if select 12th month it should show the value of 0 to 6th month value

this i am trying please help

above code showing 6th to 12th

Not applicable

hi,

Try this

=Sum({$<Month=,Fin_Year=, Date={">=$(=date(Addmonths(max(Date),-12)))<=$(=date(Addmonths(max(Date),-6)))"}>}Value)

Regards

Vimlesh

Not applicable

Hi

arulsettu
Master III
Master III
Author

Hi Vimlesh,

               it showing value between 12/1/2013 to 6/1/2014

not calculating the 0

my month starts with 0.

thanks

Not applicable

dear ,

month start 1 to 12.

how are you showing 0 to 12 ....  its 13 months in a year.

for this you make variable of months only like

vminmonth=month(date)-6

vmaxmonth=(month(date)-12

and bypass year,date etc.

Regards

Vimlesh

arulsettu
Master III
Master III
Author

please check this app