Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikhans
Creator
Creator

replacing formula by variable does not work

When I use this formula in a pivot table it just works fine. For each month I get the correct number.

=SUM({$<cat2 = {"V01"}>}Debet)-SUM({$<cat2 = {"V01"}>}Credit)

I want to limit typing, so I defined a variable (ctrl+alt+v) copy/pasting the formule and named the variable "vCalculation" . When using this variable in a pivot table ='$(vCalculation1)', each and every month generates the annual total, the subtotal generated by the pivottable also returns that same annual total. Who can help me?

1 Solution

Accepted Solutions
Not applicable

Hi,

When you define your variable don't put the '=' symbol, so the expression in your varible should be: SUM({$<cat2 = {"V01"}>}Debet)-SUM({$<cat2 = {"V01"}>}Credit) without the '=' and in your object put $(vCalculation) inside the expression

Hope this helps

Regards!

View solution in original post

2 Replies
Not applicable

Hi,

When you define your variable don't put the '=' symbol, so the expression in your varible should be: SUM({$<cat2 = {"V01"}>}Debet)-SUM({$<cat2 = {"V01"}>}Credit) without the '=' and in your object put $(vCalculation) inside the expression

Hope this helps

Regards!

qlikhans
Creator
Creator
Author

YES!!

Thank you Gabriela, that did the trick.

bst rgrds

Hans