Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
arsenal1983
Creator
Creator

Using variables in set analysis

Hi,

I would like to count all documents that have one parameter >=  defined in variable


I did this:

=count({$<PARAMETER = {$(#vPARAMETER)}>} DISTINCT DOC_NO)

it works if I would like to count DOC_NO where PARAMETER = vPARAMETER, but I would like to count DOC_NO where PARAMETER >= vPARAMETER.

regards,

L

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Try this:

=count({$<PARAMETER = {">=$(vPARAMETER)"}>} DISTINCT DOC_NO)

View solution in original post

14 Replies
oknotsen
Master III
Master III

How about this:

=count({$<PARAMETER = {>= $(#vPARAMETER)}>} DISTINCT DOC_NO)

May you live in interesting times!
Agis-Kalogiannis
Employee
Employee

Try Onno's suggestion with some extra quotes...

=count({$<PARAMETER={'>=$(#vPARAMETER)'}>}DISTINCT DOC_NO)

Anonymous
Not applicable

Try this:

=count({$<PARAMETER = {">=$(vPARAMETER)"}>} DISTINCT DOC_NO)

arsenal1983
Creator
Creator
Author

Thanks, it works.:)

How about if I would like to add two dimmesions or modify vPARAMETER

example PARAMETER  >= vPARAMETER - 360?

Anonymous
Not applicable

Probably this:

=count({$<PARAMETER = {">=$(=vPARAMETER-360)"}>} DISTINCT DOC_NO)

notice the "=" sign before vPARAMETER, it is essential here.

arsenal1983
Creator
Creator
Author

Magic! and if I would like to use another varaible instead of hardcode 360?

Anonymous
Not applicable

I guess, this:

=count({$<PARAMETER = {">=$(=vPARAMETER-vPARAMETER2)"}>} DISTINCT DOC_NO)

arsenal1983
Creator
Creator
Author

One more qestion, is it possible to use expresion with variable in argument of set something like:

=count({$<(PARAMETER - vPARAMETER3) = {">=$(vPARAMETER)"}>} DISTINCT DOC_NO)

Agis-Kalogiannis
Employee
Employee

The first part of the Set modifier is the field name.

I don't think you can do something like that.