Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Hamid_Reza_Rashidi
Contributor
Contributor

expression

Hi, everybody,

Can i define an expression , a complicated (including several lines) expression, and apply it for any Column,

for instance,

Let vYear_M: if ((Mid(CelC1,4,2)>11, Left(CelC1,2)+622,Left(CelC1,2)+621))

and when i want to use it for other cells (Column) by writing the formula 

vYear_M (CelC2)

it apply the same above formula.

Best wishes

5 Replies
Taoufiq_Zarra

Hi Hamid,

your question is not clear.
can you give us more details, an example it will be perfect.

one thing that is certain, you can use an expression in a variable and use it as much as you want

Taoufiq

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
ashwanin
Specialist
Specialist

Variable will refer to the cell referred.

Can you post a sample ?

Hamid_Reza_Rashidi
Contributor
Contributor
Author

Hi, thanks for your reply

please do check the following sample.

 

Let  x=left(y,2)

"y" is one of my column in a table.

if i writ the formula the same as followings:

Let  x=left(,2)

can i use varible x to calculate the 2 left digits of column z. (=Left(z,2)) 

= x (Z),

the the answer be the same as = left(Z,2),

Best regards

Hamid_Reza_Rashidi
Contributor
Contributor
Author

 

Hi, thanks for your reply

please do check the following sample.

 

Let  x=left(y,2)

"y" is one of my column in a table.

if i writ the formula the same as followings:

Let  x=left(,2)

can i use varible x to calculate the 2 left digits of column z. (=Left(z,2)) 

= x (Z),

the the answer be the same as = left(Z,2),

Best regards

Brett_Bleess
Former Employee
Former Employee

Also check apparent duplicate post: https://community.qlik.com/t5/QlikView-Scripting/Expressions/m-p/1655511/highlight/false#M97676

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.