Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

Replace formulae

Hi all,  @ Franky_h79    Andrey_krylov 

Sunny Talwar 

i am using

below  expression its working fine  in listbox.  where as   rate filed is coming from database directly.

=Aggr(Only({<[Rate] = {"<=0.97>=1.03"}>} [ Code]), [ Code])          [listbox expression]

but now the issue is    rate column is not coming from db . so we need to caluclate on the fly. 

so i used this  in the script to caluclate rate

Num([ AmountB]/[ AmountA], '#,##0.00%') as [Rate],

so now   my requirment is ...  i want to replace the  rate with   above expression  to be used in listbox.

=Aggr(Only({<[Rate] = {"<=0.97>=1.03"}>} [ Code]), [ Code])      -- here how can place  rate exression instead of direct rate

 

 

thanks 

sony

Labels (2)
24 Replies
tresesco
MVP
MVP

Try like:
Aggr(
If([ AmountB]/[ AmountA]<=0.97
and
[ AmountB]/[ AmountA] >=1.03 , [ Code])
, [ Code])
soniasweety
Master
Master
Author

its showing null 😞

soniasweety
Master
Master
Author

i need to use that in listbox expression 

tresesco
MVP
MVP

This could be because of granularity mismatch. Try like:

Aggr(
If( Sum([ AmountB]/[ AmountA])<=0.97
and
Sum([ AmountB]/[ AmountA]) >=1.03 , [ Code])
, [ Code])

 

If even this doesn't help. Try to share your sample app.

mikevwang
Contributor III
Contributor III

I think it should 'or' instead of 'and' and the Only should be kept in case there is a Code with multiple AmountA or AmountB's.

=Aggr(Only(If([AmountB]/[AmountA]<=0.97 or [AmountB]/[AmountA]>=1.03, [Code])), [Code]) 

soniasweety
Master
Master
Author

not working

soniasweety
Master
Master
Author

hi,

PFA.  when open the app

right side  u can see two listbox  one is for red count one is for green count... whenever i select  red count list box value it should display red value in table.

tresesco
MVP
MVP

Let me ask you - why do you want this alternative solution, just because you don't want to calculate Rate at the script, or any other reason?
soniasweety
Master
Master
Author

its not alternate solution.. because i calucalte in the script.. that field if i use in the table  its not giving me correct result.

 

and that listbox is  mapped to table so when i do selections in listbox the table is not showing the coresponding values.