Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
helen_pip
Creator III
Creator III

Can you pass a string as a variable into an expression for evaluation

Dear Qlikview user

I was wondering if it is possible to strore a string as a variable and load in the variable as part of the expression

I.e.

Num(Count({$<Week_Number,Month,QuarterName,FiscalYear,FactDateNum=P(FactDateNum_prevYr),OP_Atd_Outcome_Type={'ACTION'},

Attendance_Type={'Follow Up'}>} Dim_OP_Counter))

Could I store the Week_Number,Month,QuarterName,FiscalYear, into a variable and then call that variable?


I.e.


v_date_exclusion  = Week_Number,Month,QuarterName,FiscalYear,


Then the expression could look like this?


Num(Count({$<$(v_date_exclusion)FactDateNum=P(FactDateNum_prevYr),OP_Atd_Outcome_Type={'ACTION'},

Attendance_Type={'Follow Up'}>} Dim_OP_Counter))

Any help or guidance would be greatly apreciated

Kind Regards

Helen

1 Solution

Accepted Solutions
sunny_talwar

Syntax editor doesn't really know what you have behind the variable... so will complain... but as long as have the correct syntax expanded, it should show the right result to you... so, I would say... ignoring the syntax editor's red wiggly line... do you see the right result?

View solution in original post

5 Replies
sunny_talwar

This is doable, have you tried this and ran into issue?

helen_pip
Creator III
Creator III
Author

Dear Sunny

We have tried this but could not get the expression to OK our syntex

Num(Count({$<$(v_date_exclusion)FactDateNum=P(FactDateNum_prevYr),OP_Atd_Outcome_Type={'ACTION'},

Attendance_Type={'Follow Up'}>} Dim_OP_Counter))

Kind Regards

Helen

sunny_talwar

Syntax editor doesn't really know what you have behind the variable... so will complain... but as long as have the correct syntax expanded, it should show the right result to you... so, I would say... ignoring the syntax editor's red wiggly line... do you see the right result?

helen_pip
Creator III
Creator III
Author

Thanks Sunny

Yes, that worked!  I just assumed my syntax was wrong and went no further to test my expression

Thanks for clarifying

Thanks

Helen

sunny_talwar

No problem at all.. I would keep syntax editor as a second check. Always check the result from your expression to see if it looks right. If it does, you don't have to worry about your expression.

Best,

Sunny