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: 
Not applicable

How can I convert this IF Formula into a Variable

I am struggling to create a variable of this IF statement:

=if([Doc Type]&Function='Credit MemoMultiply',sum(Quantity*ConvFactor)*-1,if(Function='Multiply',sum(Quantity * ConvFactor), if([Doc Type]&Function='Credit MemoDiv',sum(Quantity/ConvFactor)*-1,if(Function='Div',sum(Quantity / ConvFactor),if([Doc Type]='Credit Memo',Quantity*-1,Sum((Quantity)))))))

I want my app to run faster and also to use the variable to show the result by Responsible, write now I can only obtain the result by SKU, but as soon as I take out that dimension my result change.

Any thought.

Thank you!

13 Replies
Not applicable
Author

Ok so for that expression to work all the metrics  ( Doc Type,Function,QTY , ConvFactor ) should be in the same table. If Item% has a one-to-one relationship in the Inline table with Function and ConvFactor, then you can left join just those two fields into the Link Table and use that expression in the Link table through another resident Load.

Like -

LinkTable:

Load *

Resident LinkTable;

Left Join

Load Item%,

Function,

ConvFactor

Resident Inline Table;


Load *, Expression

Resident LinkTable;

Not applicable
Author

Hi Ajay, Happy New Year!

Thanks again for your help, since I am fairly new to QV I am not able to apply what you have recommend me.

Do you have any info that I can read to understand better? and try to apply your concepts

Regards

Not applicable
Author

There is this amazing book called 'Qlikview 11 for Developers' which has all the basic things needed to understand Qlikview with good examples. I would recommend going through that.

Happy New Year!!

Not applicable
Author

Thank you for the advice, I will get it, but in the meantime do you think you can help me out with my app?