Announcements
cancel
Showing results for
Did you mean:
Contributor III

## Use of Variables in Set Analysis

Hi,

I defined a variable as vRA=max([RA.Extract]).

Then, I have an expression Sum({\$<[RA.Extract]={"\$(=max([RA.Extract]))"}>}OutOfOrder)

max([RA.Extract]) evaluated to '05/08/2016' in KPI, format: auto.

Sum({\$<[RA.Extract]={"\$(=max([RA.Extract]))"}>}OutOfOrder) evaluated to give 7, format: auto

Sum({\$<[RA.Extract]={"05/08/2016"}>}OutOfOrder) evaluated to give 7, format: auto

However, when I replace max([RA.Extract]) with vRA in the expression,

Sum({\$<[RA.Extract]={"\$(=vRA)"}>}OutOfOrder) evaluated to give 0, format: auto

Any idea why this is the case?

1 Solution

Accepted Solutions

It will depend on how the variable is exactly defined and which formatting will be returned (sense seems to work a bit different to qlikview regarding to max(AnyDate) which will return a numeric value like 42587 instead of '05/08/2016'). If you used:

vRA:

max([RA.Extract])

then you might need:

Sum({\$<[RA.Extract]={"\$(=\$(=vRA))"}>}OutOfOrder)

and by

vRA:

=max([RA.Extract])

it changed to:

Sum({\$<[RA.Extract]={'\$(vRA)'}>}OutOfOrder)

More to them could you find here: The Magic of Variables‌ and here: The Magic of Dollar Expansions.

- Marcus

2 Replies

It will depend on how the variable is exactly defined and which formatting will be returned (sense seems to work a bit different to qlikview regarding to max(AnyDate) which will return a numeric value like 42587 instead of '05/08/2016'). If you used:

vRA:

max([RA.Extract])

then you might need:

Sum({\$<[RA.Extract]={"\$(=\$(=vRA))"}>}OutOfOrder)

and by

vRA:

=max([RA.Extract])

it changed to:

Sum({\$<[RA.Extract]={'\$(vRA)'}>}OutOfOrder)

More to them could you find here: The Magic of Variables‌ and here: The Magic of Dollar Expansions.

- Marcus

Contributor III
Author

Thanks Marcus! Tried this and it worked

Tags