10 Replies Latest reply: Nov 10, 2016 4:18 AM by Denis V

Variables in sum

Hello,

Maybe can someone tell me what i am doing wrong. My task is to calculate sum of previous DrawID starting from today.

Right answer i get when do like this :  sum({\$<DrawID = {'<3'} >}[Ticket.Amout] )

I defined  variable vCurrentEdition like this  Num#(if( DrawDate = today() , DrawID),'#.#', '.' , ','),  also tried if( DrawDate = today() , DrawID) both variations gives the right answer 3 .

To count sum i tried this variations:

sum({\$<DrawID = {'< \$(vCurrentEdition)'} >}[Ticket.Amout] )

sum({\$<DrawID = {"< \$(vCurrentEdition)"} >}[Ticket.Amout] )

sum({\$<DrawID = {'< vCurrentEdition'} >}[Ticket.Amout] )

sum({\$<DrawID = {"< vCurrentEdition"} >}[Ticket.Amout] )

sum({\$<DrawID = {vCurrentEdition} >}[Ticket.Amout] )

Unfortunately none of them works. What should i do to count sum.

• Re: Variables in sum

Can you try this:

Sum({\$<DrawID = {'<\$(=vCurrentEdition)'} >}[Ticket.Amout])

• Re: Variables in sum

Hello, thank for fast replay. It does not work

• Re: Variables in sum

How about if you change single quotes to double quotes here?

Sum({\$<DrawID = {"<\$(=vCurrentEdition)"} >}[Ticket.Amout])

• Re: Variables in sum

Try this one

=Sum({\$<DrawID = {<\$(=\$(vCurrentEdition))} >}[Ticket.Amout])

• Re: Variables in sum

Does not work. I also tried with different quotes.

=Sum({\$<DrawID = { ' <\$(=\$(vCurrentEdition)) ' } >}[Ticket.Amout])

=Sum({\$<DrawID = { " <\$(=\$(vCurrentEdition)) " } >}[Ticket.Amout])

• Re: Variables in sum

Already tried. does not work. Maybe something wrong with my variable

• Re: Variables in sum

Try putting '=' before expression while defining your variable.

• Re: Variables in sum

Thanks for suggestion. I tried, but nothing changed.