Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need expression

Hi all,

   i have a data set like this for the current month i need to show the previous month actual values.and for the

remaining months it should be outlook values(i will get data from jan-dec for every month). !

PFA

5 Replies
Anonymous
Not applicable
Author

Hi Sruti,

Can you be bit more clear on your requirement????

tresesco
MVP
MVP

Like this?

If(month=Month(Today()),Sum({<scenario={'actuals'}>}fin),Sum({<scenario={'outlook'}>}fin))

PFA

Not applicable
Author

Hi Tresesco,

In the If condition it will take only today month.but wat i need is from jan to today's month it should be actulas

and remaining all are outlook values

jagan
Partner - Champion III
Partner - Champion III

Hi,

Then try like this

If(month < Month(Today()),Sum({<scenario={'actuals'}>}fin),Sum({<scenario={'outlook'}>}fin))


OR if you have a date field then try like this


If(DateFieldName < Today(), Sum({<scenario={'actuals'}>}fin),Sum({<scenario={'outlook'}>}fin))


Hope this helps you.


Regards,

Jagan.

jagan
Partner - Champion III
Partner - Champion III

Hi,

I used < in condition, so it will return the values upto the current month.  Or in script you can try like this

Data:

LOAD

*,

'Actual' AS Data

FROM ActualData

WHERE Date < Today();

Concatenate(Data)

LOAD

*,

'Outlook' AS Data

FROM OutlookData

WHERE Date >= Today();

Now in frontend there is no need of conditions at all, you can just use Sum(fin).

Hope this helps you.

Regards,

Jagan.