Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
yanivvl0
Creator III
Creator III

Why Set Analysis with variable Increas result instead Decreas.

hi to all  , i have a text box tht calculate something like this :  sum (    {$<Subject={1},[status]={3}>}   amount )   

and i have a variable like this : vY = if (  type38=1 or type39=1 , amount , 0  )   

when i replace  amount  with  $(vY)   i expect to see that the result will Decreas Significantly BUT instead i see Increas ,

what could be the problem ??

i exported the data to another model - and its work OK !? 

thanks .

6 Replies
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

It is hard to tell with out looking at your datamodel. Can you post a sample app.

yanivvl0
Creator III
Creator III
Author

hi phaneendra.kunche  ,

it is a complicate model and sensitive data , so its a bit difficult to  show it .

Anyway, I gave up ... - I solved the problem in the script .

                                                                                                                - thanks!

sujeetsingh
Master III
Master III

may be repetition of data? cross joining ? etc

Not applicable

Hi Yaniv

If the data works on another model, you are probably changing the 'vY' variable somewhere else in your script

Maybe put a trace on that variable to see if it has the expected value after the load.

luciancotea
Specialist
Specialist

In the expression of vY, remove the preceding '='

swuehl
MVP
MVP

[Assuming your variable expands to

sum (    {$<Subject={1},[status]={3}>}   if (  type38=1 or type39=1 , amount , 0  )   )


it's often a good idea to simplify the expression first, e.g. test with a hard coded expression to eliminate an issue with variable dollar sign expansion

]

What is the relation of fields type38,type39 and amount? Do these fields reside in the same table or in different tables?

If they reside in different tables, QV may need to do a temporary join of tables to make the record-level comparison possible, this may duplicate your amounts in comparison to the first version.