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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filter by Max(Date) in Set Analysis

Hi All!!

This it´s my first post

I have a textbox with the following expression=

if(getselectedcount (calend.month)=0,
sum({1<[DIM_MONEDA_ID] = {'USD'},common_date={'>=$(vMaxDate)'}, FIG.FACT_EST_TABLA_ORIGEN={'REAL'},FIG.DIM_ITEM_REPORTE_KEY={'CONTRIBUTION MARGIN'} >} FIG.FACT_EST_VALOR),
sum({1<[DIM_MONEDA_ID] = {'USD'},common_date=P(common_date),FIG.FACT_EST_TABLA_ORIGEN={'REAL'},FIG.DIM_ITEM_REPORTE_KEY={'CONTRIBUTION MARGIN'} >}
  if(common_date=$(vMaxDate),FIG.FACT_EST_VALOR)))

where :

calend.month = Month on master calendar

DIM_MONEDA_ID = Currency dimension, i'm filtering only by USD

common_date = master date in master calendar

FIG.FACT_EST_TABLA_ORIGEN = Always "REAL"

FIG.DIM_ITEM_REPORTE_KEY = Always "CONTRIBUTION MARGIN"

FIG.FACT_EST_VALOR = Field to be added in expression


The calend.month are filter by user. Texbox will be show only the max month selected when currency = USD, Tabla Origen = "Real" and ITEM_REPORTE_KEY = "CONTRIBUTION MARGIN". If the user haven't made selections, textbox shows the value of the last month charged.


I have the following behavior associated to month selections by users


- If the user haven't month selected, textbox shows correctly the sum(values) of last month.

- If the users have one month selected, textbox shows correctly the sum(values) of selected month

- If the users have 2 or more month selected, textbox shows the sum of all month selected.


I need to shows always the max(month) independent of month selections.


Any suggestion?


PS: Please apologies for my english.

10 Replies
sunny_talwar

I am glad that I proved useful.

Best,

S