Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
siewmei_lsm
Contributor II
Contributor II

Set flag using max function

Hi,

Below expression work in table visualization but when i used the same to add into data modeling to set it as flag, it show invalid expression. How to convert below into flag in data modeling?

IF(Max(FORECASTED_DATE)=Max(PRIOR_FORECASTED_DATE),'N','Y') as FORECASTED_CHANGE

data modeling:

LOAD
*,
IF(Max(FORECASTED_FPS_DATE)=Max(PRIOR_FORECASTED_FPS_DATE),'N','Y') as FORECASTED_FPS_CHANGE

resident funnelsnap;

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hi 

in order to use aggr functions in the script 

you need to use group by and say which dimension to use 

and then joining it to your source table something like 

left join (funnelsnap)

LOAD
DIM,
IF(Max(FORECASTED_FPS_DATE)=Max(PRIOR_FORECASTED_FPS_DATE),'N','Y') as FORECASTED_FPS_CHANGE

resident funnelsnap
group by DIM

;

View solution in original post

1 Reply
lironbaram
Partner - Master III
Partner - Master III

hi 

in order to use aggr functions in the script 

you need to use group by and say which dimension to use 

and then joining it to your source table something like 

left join (funnelsnap)

LOAD
DIM,
IF(Max(FORECASTED_FPS_DATE)=Max(PRIOR_FORECASTED_FPS_DATE),'N','Y') as FORECASTED_FPS_CHANGE

resident funnelsnap
group by DIM

;