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

Resolving two vars side-by-side

How can I resolve two variables: "$(Topic)$(Subject) " side-by-side? I have created a nested For ... Next... loop... . I get an error message and it looks like QV only resolves the 1st one and ignores the other...

Actual Code is:

For each Topic in 'NP' ,'SS'

For each Subject in Math, Reading, Total, Writing

PSAT:
Load
SetID&'-'&num(StudentCode) as KeyfromStudentEW, //PK for entire PA Edmonds App
$(Topic)$(Subject) as PSATScaleScore,
'$(Topic) $(Subject)' as PSATSubjectTemp
Resident PSATTemp
;

Next Subject

Next Topic

Thanks,

Stephanie

2 Replies
Miguel_Angel_Baeyens

Hello Stephanie,

Your second for each line should read

For each Subject in 'Math', 'Reading', 'Total', 'Writing'


All text values must be enclosed in quotes, so it has

'$(Topic)$(Subject)' as PSATSubjectTemp


Because "$(Topic)$(Subject)" is not a name of a field, but a text value. Apart from that, your code seems correct to me.

Regards.

Not applicable
Author

Thank you very much. Can't believe i missed the single quotes for the one "For next" statements... good catch.

Thanks for your response.... my code now works ! Smile

Thanks,

Stephanie Lind