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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis in Chart Expressions.

Hi

Set Analysis in Chart Expressions.

As a newcomer to QV I am struggling on the following and would appreciate some help :

Analysing the General Ledger, I am trying to select forecast data (_FCast1) if the selection in _Per1 (months 1 up to 12)
is greater than the current Actual period (_CurrentPer) where _Per1 is a selection field that will span periods either side of the_CurrentPer

All I keep getting is 'Actual' data
I am using :


NUM((
sum({$<
GL.Year={$(=(maxstring(_Yr1)))},
GL.Period={$(=(getfieldselections(_Per1,',',12)))},
GL.ForecastCategory={$(=if(getcurrentfield (_Per1) > maxstring(_CurrentPer), maxstring(_Fcast1), 'Actual' )) }
>}
[GL.Value]

Thanks

5 Replies
trdandamudi
Master II
Master II

I think you are missing single quotes.. Give a try on the below expression...

NUM((

sum({$<

GL.Year={'$(=(maxstring(_Yr1)))'},

GL.Period={'$(=(getfieldselections(_Per1,',',12)))'},

GL.ForecastCategory={'$(=if(getcurrentfield)' > maxstring(_CurrentPer), maxstring(_Fcast1), 'Actual' ) }

>}

[GL.Value]

Is this doesn't work can you please post a small sample...

Not applicable
Author

Tried this - it gets rid of actual data also !

Here is a (Very) small sample of data, thanks

   

GL.ForecastCategoryGL.TransDescriptionGL.ValueGL.YearGL.PeriodBusinessUnit
ActualGROSS SALARIES22364.9820161501
ActualGROSS SALARIES25834.9720162501
ActualGROSS SALARIES33257.3320163501
ActualGROSS SALARIES34108.9320164501
ActualGROSS SALARIES34400.620165501
ActualGROSS SALARIES34628.0320166501
M07F16GROSS SALARIES22364.9820161501
M07F16GROSS SALARIES25834.9720162501
M07F16GROSS SALARIES33257.3320163501
M07F16GROSS SALARIES34108.9320164501
M07F16GROSS SALARIES34400.620165501
M07F16GROSS SALARIES34628.0320166501
M07F16GROSS SALARIES3500020167501
M07F16GROSS SALARIES3500020168501
M07F16GROSS SALARIES3500020169501
M07F16GROSS SALARIES35000201610501
M07F16GROSS SALARIES35000201611501
M07F16GROSS SALARIES35000201612501

   

Anonymous
Not applicable
Author

Apart from single quotes. For num function you should give the number format parameters. See example below

num($(=%KPIPct),'#,##0.0#%')

Share the sample file we might be able to help you and let us know what format the data needs to be in.

boorgura
Specialist
Specialist

NUM((

sum({$<

GL.Year={$(=(maxstring(_Yr1)))},

GL.Period={$(=(getfieldselections(_Per1,',',12)))},

GL.ForecastCategory={$(=if(getcurrentfield (_Per1) > maxstring(_CurrentPer), maxstring(_Fcast1), 'Actual' )) }

>}

[GL.Value]


GetCurrentField is to retrieve the current field within a GROUP. But you mentioned _Per1 is a FIELD.

Not applicable
Author

_Per1,           _Yr1           and               _Fcast1  

are all List boxes from data islands created from all possible data in the GL.

I am using data islands as there are many more tables to be joined to the GL data

These other data sets have currently been dropped from the load script