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: 
souadouert
Specialist
Specialist

set analysis with expresison

how two covert this expresion to set analysis expression

sum(if( mid($(DATE),3,2) = right(DATE_PRODUCTION,2) ,amout))

5 Replies
sumeet-vaidya
Partner - Creator
Partner - Creator

Hi Souad,

Create a Column in your script for Right(DATE_PRODUCTION,2) AS DATE_PRODUCTION_NEW.

And use below Expression.


Sum({<DATE_PRODUCTION_NEW = {"$(=Mid(DATE),3,2)"} >} Amount)


Regards

Sumeet

souadouert
Specialist
Specialist
Author

i am not allow to modify the script

tresesco
MVP
MVP

Is DATE in sum(if( mid($(DATE),3,2).... a variable?

dwforest
Specialist II
Specialist II

if the IF statement is working, not necessarily a better idea to use SET Expression.

Because the fields do not contain the exact matching you are after, it gets a bit more complex to do a Set Expression since left side must be a field only.

In order to do this, there must be a primary key,e.g. ID_FIELD,  in your data set

Sum({<ID_FIELD= {"=$(=Mid(DATE),3,2) )= $(=right(DATE_PRODUCTION,2))"} >} Amount)

vishsaggi
Champion III
Champion III

May be try this?

= sum({< Amount = {"=if( mid($(DATE),3,2) = right(DATE_PRODUCTION,2) ,amount)"} >} Amount)