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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
janeee__
Contributor II
Contributor II

qlik expression

Hello Guys,

I need to get the value of sales of the maximum month that is not null, how to do that

i tried this but didn't work 

Sum(
FirstSortedValue(
{<sales-={"0"}>} sales/ 1000000,
date
)
)

Labels (2)
4 Replies
marksouzacosta

Hi @janeee__ ,

Can you please try this?

Sum({<date = {'$(=Max({<sales = {">0"}>} date))'}>} sales)

 

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

janeee__
Contributor II
Contributor II
Author

thanks @marksouzacosta for your response it works for some records and no for others

for exemple it displays 0 in the table for some participation that have value but whene i clik on participation filter, it displays the right value, i don't know why

it give me result only of max date =01/08/2024

if participation has value on dec 2021 it gives me 0

here's my expression

aggr(Sum({<debut_mois = {'$(=Max({<net_c-={"0"}>} debut_mois))'}>} DISTINCT net_c/1000000),participation)

marksouzacosta

Hi @janeee__,

This is because the Aggregation you are using.
Max({<net_c-={"0"}>} debut_mois) will return the Max debut_mois disregarding the aggregation you are using.

If you need to consider participation or other dimensions, you can add those as Dimensions in your chart and remove the Aggr statement. What is the chart you are trying to do? Can you please send a screen shot?

 

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

Kushal_Chawda

@janeee__  If each Participation has different max date,  try below

= FirstSortedValue( distinct {<net_c={">0"}>} aggr(sum(net_c),participation,debut_mois), -debut_mois)