Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
arulsettu
Master III
Master III

LYTD showing only one record vale

hi,

     i am trying to show lytd values below code i used

=sum({<ACNT_FLEX_03={'1- Gross Premiums'},TD_DRCR_FLAG={'D'},TBAL_CAL_YEAR=,datefield={">=$(=date(YearStart(max(datefield),-1)))<=$(=AddYears(max(datefield),-1))"}>}TD_AMT_LC_1)-sum({<ACNT_FLEX_03={'1- Gross Premiums'},TD_DRCR_FLAG={'C'},TBAL_CAL_YEAR=,datefield={">=$(=date(YearStart(max(datefield),-1)))<=$(=AddYears(max(datefield),-1))"}>}TD_AMT_LC_1)

but the result is showing incorrect valeus

can anyone check above code is correct

Thanks

6 Replies
arulsettu
Master III
Master III
Author

any idea?

jonathandienst
Partner - Champion III
Partner - Champion III

Looks syntactically correct to me. I suggest that you post a sample to show what you get and explain what you are expecting. Its a lot easier (for you as well) to ensure that this statement

=sum({<datefield={">=$(=date(YearStart(max(datefield),-1)))<=$(=AddYears(max(datefield),-1))"}>} TD_AMT_LC_1)

works correctly before trying to work it out in the full expression above.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Hi,

sum({<SaleDate={">=$(=date(YearStart(max(SaleDate),-1)))<=$(=AddYears(max(SaleDate),-1))"}>}Sales)

This part is correct, can't say about your other modifiers, break your expression in steps and then check which one is incorect.

Regards,

Navdeep

PrashantSangle

Hi,

Try this

=sum({<ACNT_FLEX_03={'1- Gross Premiums'},TD_DRCR_FLAG={'D'},TBAL_CAL_YEAR=,datefield={">=$(=date(AddYears(YearStart(max(datefield)),-1)))<=$(=AddYears(max(datefield),-1))"}>}TD_AMT_LC_1)-sum({<ACNT_FLEX_03={'1- Gross Premiums'},TD_DRCR_FLAG={'C'},TBAL_CAL_YEAR=,datefield={">=$(=date(AddYears(YearStart(max(datefield)),-1)))<=$(=AddYears(max(datefield),-1))"}>}TD_AMT_LC_1)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
arulsettu
Master III
Master III
Author

Hi Jonathan,

                    here is the sample data.

                      

                        it shows energy value as 182000

when i check my db i have value like this

          acc code    value

Energy319001-182000
Energy319003-75843.327

in my chart it shows for account code 319001 value

why its not showing other records

jonathandienst
Partner - Champion III
Partner - Champion III

That's too large, see here:

Preparing examples for Upload - Reduction and Data Scrambling

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein