Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

hamdaniahmad
New Contributor III

Get Qty From Max Date

Hello All,

I have some question expression in Qlik Sense,

From attached table, I wanna get Qty from last stock (last date).

I'm using this formula in QlikView :

sum({<Date_Fix={'$(=max({<DESC={'STOCK'}>}Date_Fix))'}>}qty_stock)

Expression is no problem in QlikView (although still visible red line, maybe error) , until I copied to Qlik Sense.

Expression doesn't work in qlik sense, no value from formula.

Anyone can help me..?

Thanks

   

Date_Fixqty_StockDESC
1/15/20187STOCK
1/16/20183STOCK
1/17/20186STOCK
1/18/20186STOCK
1/19/20183STOCK
1/20/20189STOCK
1/21/20182STOCK
1/22/20188STOCK
1/23/20182STOCK
1/24/20187STOCK
1/25/20180STOCK
1/26/20182STOCK
1/27/20185STOCK
1/28/20188STOCK
1/29/20189STOCK
1/30/20182STOCK
1/31/20186STOCK
2/1/20187STOCK
2/2/20188STOCK
2/3/20183STOCK
2/4/20185STOCK
2/5/20186STOCK
2/6/20188STOCK
2/7/20185STOCK
2/8/20187STOCK
2/9/20182STOCK
1 Solution

Accepted Solutions
thiago_justen
Valued Contributor III

Re: Get Qty From Max Date

Check this out:

sum({<Date_Fix={"$(=max({<DESC={'STOCK'}>}Date_Fix))"}>}qty_stock)


Double quotes will make difference here.

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
3 Replies
thiago_justen
Valued Contributor III

Re: Get Qty From Max Date

Check this out:

sum({<Date_Fix={"$(=max({<DESC={'STOCK'}>}Date_Fix))"}>}qty_stock)


Double quotes will make difference here.

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
hamdaniahmad
New Contributor III

Re: Get Qty From Max Date

Thank you Thiago, it's worked for me..!!

Do you can explain, when we must use single quotes or double quotes in expressions?

thiago_justen
Valued Contributor III

Re: Get Qty From Max Date

As you can see follow this link - Re: Set analysis difference between single quote and double quote

Double quotes: Case insensitive search where * and ? are interpreted as wildcards

Single quotes: Case sensitive string match where *, ?, =, > and ~ all are treated as any characters

In another word, single quotes should denote literals, and double quotes should initiate a search.

Check this:

A Primer on Set Analysis

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
Community Browser