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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
samuel_brierley
Creator
Creator

Quick formula check

Hi all,

thanks for any help on this,

the below is a snippet of a formula that isnt evaluating.

the issue seems to be the only segment because if i replace it with its value (1200) it works fine.

any suggestions?

=

avg(IF(RampDataFilteringOutput.Loopp1.sORLoopK > 35 and RampDataFilteringOutput.Loopp2.sORLoopK > 35 and
ArbitrationInput.Group.rOOk < only( {$< [/rec/parameter] = {'rOff'},[/#text] = {'CommonParameters'},[Config] = {Live}>}[/rec/parameter/curval])
,1,2))

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

If the Only statement is returning a correct value in a seperate text box, the easy solution would be to create a variable with the only expression like (e.g. vParameter)

= only( {$< [/rec/parameter] = {'rOff'},[/#text] = {'CommonParameters'},[Config] = {Live}>}[/rec/parameter/curval])

DO include the = sign, so it will evaluate at the variable level, in your expression replace the Only(..... with

$(vParameter)

View solution in original post

7 Replies
terezagr
Partner - Creator III
Partner - Creator III

hi

I think it does not know what to evaluate - try to add a brackets as follow:(RampDataFilteringOutput.Loopp1.sORLoopK > 35 and RampDataFilteringOutput.Loopp2.sORLoopK > 35 and  ArbitrationInput.Group.rOOk)

avg(IF((RampDataFilteringOutput.Loopp1.sORLoopK > 35 and RampDataFilteringOutput.Loopp2.sORLoopK > 35 and
ArbitrationInput.Group.rOOk) < only( {$< [/rec/parameter] = {'rOff'},[/#text] = {'CommonParameters'},[Config] = {Live}>}[/rec/parameter/curval])
,1,2))

samuel_brierley
Creator
Creator
Author

Hi, thanks for the quick response, I dont think the brackets are the issue as the value works and ive just tried with creating a variable in the script and that worked too.

terezagr
Partner - Creator III
Partner - Creator III

have you tried put {'Live'} into a single quotes?

samuel_brierley
Creator
Creator
Author

Again yup ive tried that, and ive also put the only statement in a text box to ensure that its actualy returning a number and it is. really quite annoying

terezagr
Partner - Creator III
Partner - Creator III

Could you please explain what you are trying to do with your formula?

stigchel
Partner - Master
Partner - Master

If the Only statement is returning a correct value in a seperate text box, the easy solution would be to create a variable with the only expression like (e.g. vParameter)

= only( {$< [/rec/parameter] = {'rOff'},[/#text] = {'CommonParameters'},[Config] = {Live}>}[/rec/parameter/curval])

DO include the = sign, so it will evaluate at the variable level, in your expression replace the Only(..... with

$(vParameter)

samuel_brierley
Creator
Creator
Author

thanks this is the way Ive done it