Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum function text and fields

Hi

Please can you help me with the below expression:

= Sum ( {$<STTR_STATUS = {50, 99}, OrderType = {20}, FY= {"F"& Right(text(CURRENTYEAR),4)} >} OrderValue)

The formula below works for the current year however I can not get it to work for last year as above.

= Sum ( {$<STTR_STATUS = {50, 99}, OrderType = {20}, FY= {$(CURRENTYEAR)} >} OrderValue)

CURRENTYEAR is a variable defined in the script.

I have tried several variations of the above code without sucess. Any suggestions would be appreciated.

Thanks, Gareth

1 Reply
jonathandienst
Partner - Champion III
Partner - Champion III

Gareth

How about defining a variable called PRIORYEAR at the same point as CURRENTYEAR, but one yeat before?

(Not sure how your first expression would produce data for the prior year, but the string calculation should be enclosed in $(=...), ie:

FY= {"$(='F'& Right(text(CURRENTYEAR),4))"}

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein