Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
eduardoheres
Contributor III
Contributor III

select only the max of a dimension

Hi All,

Hope you have a great day. Im trying to set the max of the months depending in a current dimension. But let me explain my problem, I have a P&L where i have the months from January to december but also i have my balance sheet so when i choose for example January and february i want that my balance sheet only select february

how can i do that?

Thank you!!

 

 

 

Labels (2)
1 Solution

Accepted Solutions
felipedl
Partner - Specialist III
Partner - Specialist III

As an example i have:

x:
load
num(date) as Num_Date,
*;
load * Inline
[
date,type,value
01/01/2018,ab,300
01/01/2018,a,100
01/01/2019,a,100
02/01/2019,ab,200
03/02/2019,ac,300,
05/04/2019,d,400
];

 

Next, the expression:

sum({<Num_Date={"$(=max(Num_Date))"}>}value) (based on the numerical representation)

 

sample.png

 

Could be the formatting as you stated.

View solution in original post

5 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Your expressions should consider the max of date dimension .

Let's say you have something like:
sum(Balance_sheet_value)
when you select two months, it'll get the model for both.

With set analysis expression, you'd have something like:
sum({<[Date Field]={"$(=max([Date Field]))"}>}Balance_sheet_value)

this way, even if you have n dates selected, the section between brackets will evaluate only to the max selected month.

eduardoheres
Contributor III
Contributor III
Author

Thanks a lot,

but i get all zero

this the formula 

Sum({<[MONTH-Month]={"$(=max([MONTH-Month]))"}>}[AMOUNT BS])

maybe is because my months are in general format?

eduardoheres
Contributor III
Contributor III
Author

Thanks a lot,

but i get all zero

this the formula

Sum({<[MONTH-Month]={"$(=max([MONTH-Month]))"}>}[AMOUNT BS])

maybe is because my months are in general format?
felipedl
Partner - Specialist III
Partner - Specialist III

As an example i have:

x:
load
num(date) as Num_Date,
*;
load * Inline
[
date,type,value
01/01/2018,ab,300
01/01/2018,a,100
01/01/2019,a,100
02/01/2019,ab,200
03/02/2019,ac,300,
05/04/2019,d,400
];

 

Next, the expression:

sum({<Num_Date={"$(=max(Num_Date))"}>}value) (based on the numerical representation)

 

sample.png

 

Could be the formatting as you stated.

eduardoheres
Contributor III
Contributor III
Author

Thank you!!