Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
eduardoheres
New Contributor

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!!

 

 

 

1 Solution

Accepted Solutions
Partner
Partner

Re: select only the max of a dimension

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.

5 Replies
Partner
Partner

Re: select only the max of a dimension

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.

Highlighted
eduardoheres
New Contributor

Re: select only the max of a dimension

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
New Contributor

Re: select only the max of a dimension

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?
Partner
Partner

Re: select only the max of a dimension

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
New Contributor

Re: select only the max of a dimension

Thank you!!