Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

syntax set analysis

Hi i have a calculation whereby i calculate accumulated value. This works well for current year 2013/2014

=Sum(

        {$<

            FYear={"$(=Dual(Max(fYear)-1 &'/'& Max(fYear), Max(fYear)))"},

            fMonth={"<=$(==Max( {<fYear={$(=Max(fYear))}>} fMonth))"}

        >}

        Nettobelopp)

i have tried to show previous year without any luck 2012/2013. i think my syntax is wrong, any ideas?

=Sum(

        {$<

            FYear={"$(=Dual(Max(fYear)-2 &'/'& Max(fYear) -1, Max(fYear)-1))"},

            fMonth={"<=$(==Max( {<fYear={$(=Max(fYear)-1)}>} fMonth))"}

        >}

        Nettobelopp)

Best

Brad

1 Solution

Accepted Solutions
MayilVahanan

HI

Try like this

=Sum(

  {<

  FYear={"$(=Dual(Max(fYear)-2 &'/'& (Max(fYear)-1), Max(fYear)-2))"},

  fMonth={"<=$(=Max( {<fYear={$(=Max(fYear))}>} fMonth))"}

  >}

  Nettobelopp)

or

Try like this

=Sum(

  {$<

  fYear={$(=Max(fYear)-1)},

  fMonth={"<=$(=Max({<fYear={$(=Max(fYear))}>} fMonth))"},

  FYear=

  // månad,dag,datum

  >}

  Nettobelopp)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
MayilVahanan

Hi

can you explain FYear contains data format?


can you provide any sample data / sample file?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thank you for your reply

i have attached the file.

the format of the FYear = 2013/2014;

MayilVahanan

HI

Try like this

=Sum(

  {<

  FYear={"$(=Dual(Max(fYear)-2 &'/'& (Max(fYear)-1), Max(fYear)-2))"},

  fMonth={"<=$(=Max( {<fYear={$(=Max(fYear))}>} fMonth))"}

  >}

  Nettobelopp)

or

Try like this

=Sum(

  {$<

  fYear={$(=Max(fYear)-1)},

  fMonth={"<=$(=Max({<fYear={$(=Max(fYear))}>} fMonth))"},

  FYear=

  // månad,dag,datum

  >}

  Nettobelopp)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.