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: 
Not applicable

Sum between two date

Hi, I´m new in QV and I have this problem.

I have a table with a few columns, I need to generate a graph that sum the Column AQN_Vol_Baseline_IVA if the column AQN_Fecha_R_Adj.Day is between 1/1/2010 and 31/3/2010. The first field is a number and the second is a date.

Thanks so much.

1 Solution

Accepted Solutions
Not applicable
Author

hi,

try something like this:

sum({$<AQN_Fecha_R_Adj.Day= {">= 1/1/2010 <= 31/3/2010"}>} AQN_Vol_Baseline_IVA )
Alex


View solution in original post

5 Replies
Not applicable
Author

hi,

try something like this:

sum({$<AQN_Fecha_R_Adj.Day= {">= 1/1/2010 <= 31/3/2010"}>} AQN_Vol_Baseline_IVA )
Alex


Not applicable
Author

Alex, thaks so much for your quick answer, I think I´m doing something wrong....I change some field names but I can show you what's going on:

sum({$<date([Fecha Real de Adjudicación])= {">= 1/1/2010 <= 31/3/2010"}>} [Volumen Baseline Año 1] )

I detect that the field [Fecha Real de Adjudicación] is not in the format 1/1/2010 and I use date([Fecha Real de Adjudicación]) but something is wrong...

Fecha Real de Adjudicación date ([Fecha Real de Adjudicación]) sum({$<date([Fecha Real de Adjudicación])= {">= 1/1/2010 <= 31/3/2010"}>} [Volumen Baseline Año 1] )
4022617/02/2010
4024205/03/2010
4020729/01/2010
4020628/01/2010
4022819/02/2010
4023122/02/2010
4021809/02/2010
4026225/03/2010
4025518/03/2010
4022516/02/2010
4021304/02/2010
4021910/02/2010
4024811/03/2010
4024003/03/2010
4024912/03/2010
4026023/03/2010
4024710/03/2010
4023223/02/2010
4025922/03/2010
4022415/02/2010
4022112/02/2010
4025215/03/2010
4025619/03/2010
4023801/03/2010
4024104/03/2010
4022718/02/2010
4023526/02/2010
4026831/03/2010
4026629/03/2010
4023324/02/2010
4026730/03/2010
4027608/04/2010
4026326/03/2010
4028012/04/2010
4027709/04/2010


Not applicable
Author

Alex, I really appreciate if you could see my new message, regards.

johnw
Champion III
Champion III

So far as I know, you can't use set analyis on expressions, only on fields. In other words, I don't think you can use a function on [Fecha Real de Adjudicación] inside of set analysis. You CAN specify expressions in the search expression using dollar sign expansion, but that's completely different.

My suggested solution would be to format [Fecha Real de Adjudicación] as a date either with a date() function in the load, or by going to document properties, number, select the field, select "Date" as the format, specify the format pattern, and checkmark "survive reload". Then simplify your expression as follows:

sum({<[Fecha Real de Adjudicación]={">= 1/1/2010 <= 31/3/2010"}>} [Volumen Baseline Año 1])

If you WANT to keep it formatted as a number most of the time in your document, you will have to convert your two dates to the same numeric format. If they are literals like you show, just use the equivalent numeric literals:

sum({<[Fecha Real de Adjudicación]={">= 40179 <= 40268"}>} [Volumen Baseline Año 1])

Not applicable
Author

John, thanks so much. It works great.