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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
suvechha_b
Creator III
Creator III

How to write the expression ?

I have declare the following :

MonthPeriod:

Load * inline [

     Fiscal Month,Period   

     Jul,1

     Aug,2

     Sep,3

     Oct,4

     Nov,5

     Dec,6

     Jan,7

     Feb,8

     Mar,9

     Apr,10

     May,11

     Jun,12   

     ];

one variable : vPrevious :Month(AddMonths(Date(Today()),-1)) which gets the value " feb "

I want to use the value 8 from the inline function MonthPeriod for the below expression :

sum({<[fis_period] = {8} >}[Stag Forecast Units])

as fis_period use 8 instead of feb .

But the above query is incorrect . Please help me to write the expression.

13 Replies
MK_QSL
MVP
MVP

Can you load your sample file or sample data along with your requirements?

Not applicable

Hi,

Try this

Create a variable

vPrevMonth= NUM(Month(AddMonths(Today(),6-1)))

SUM({<[fis_period] = {$(vPrevMonth)}>}[Stag Forecast Units])

or

=SUM({<[fis_period] = {'$(=NUM(Month(AddMonths(Today(),6-1))))'}>}[Stag Forecast Units])

Note: Differance in your calender and our calender

your calender starts from Jul

suvechha_b
Creator III
Creator III
Author

See the field sample .

SUM({<[fis_period] = {'$(=NUM(Month(AddMonths(Today(),-1))))'}>}[Stag Forecast Units])

the above expression is giving value of fis_period = 2

but I want fis_period as 8 thus I have declare in Inline Tab :

MonthPeriod:

Load * inline [

     Fiscal Month,Period   

     Jul,1

     Aug,2

     Sep,3

     Oct,4

     Nov,5

     Dec,6

     Jan,7

     Feb,8

     Mar,9

     Apr,10

     May,11

     Jun,12   

     ];

feb, 8

PFA.

PrashantSangle

Hi,

Go to vw_fact_dop_forecast_stagger table

rename fis_period field as Period

OR

fis_period field as [Fiscal Period]

So that You can create Link between vw_fact_dop_forecast_stagger and Your Inline Table

Then Use Your Expression,

It will work correctly,

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂