Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

get variable dynamically and use it in set analisys

hi,

I am trying to create 1 application in which when nothing is selected, my minimum and maximum, is equal to my maximum and to be able to use in a set analisys.

this is what i want but with no selection:

image1.bmp

i don't want the Record with "100" in Factkey:

image2.bmp

i have tried with something like this but with no sucess

let vMinFactDate=if($(vSelected) = 0,'"%(=max(FactKey))"','"%(=min(FactKey))"');"

can you help me ?

a small apllication in attach

thanks in advance

Ricardo

8 Replies
vishsaggi
Champion III
Champion III

I might be wrong, just check this may be?

See attached.

Anonymous
Not applicable
Author

thanks

It works but what I wanted was to change the contents of the variable vDisplayMinFactDate because I have many set analisys expressions that use it.

it's possible ?

vishsaggi
Champion III
Champion III

Can you elaborate please. I did not change any variable values in that file. Can you give some examples?

Anonymous
Not applicable
Author

hi Vishwarath Nagaraju

i want to use the variable (for instance) "vOldValue"

where :

let vOldValue='sum({<FactKey={'& chr(39) & chr(36) &'(vDisplayMinFactDate)'& chr(39) & '}>} #Value)';

so i want to change the variable "vDisplayMinFactDate" depending on the selection.

"Min value" if i have anyting selected

"Max value" if i dont have any selection.

Now it's clear to you?

Regards

Ricardo

Anonymous
Not applicable
Author

I'm a little confused but does this get you what you want?

let vDisplayMinFactDate=if($(vSelected)=0,max({1<FactKey = {"$(=max(FactKey))"}>} FactKey),min({1<FactKey = {"$(=min(FactKey))"}>} FactKey))

vishsaggi
Champion III
Champion III

Where do you want to display those? Can you replicate your output you are expecting when you select and when you don't ? The variable should function based on selections. No changes were done to them.

Anonymous
Not applicable
Author

Wallo

i got "Syntax error

Unexpected token: 'GetSelectedCount', expected nothing

let vDisplayMinFactDate   =if(=>>>>>>GetSelectedCount<<<<<<(FactKey)=0, max({1<FactKey = {""}>} FactKey), min({1<FactKey = {""}>} FactKey))"

Anonymous
Not applicable
Author

i want to have a lot of expressions using a variable depending on select.

let vOldValue= 'sum({<FactKey={'& chr(39) & chr(36) &'(vDisplayMinFactDate)'& chr(39) & '} >} #Value)';.

image1.bmp

.