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

Using hierarchical group day month stock (Uso de grupo jerárquico día mes para stock)

I have a stock graph in which high stock units on each date.

The hierarchical group's day >> month

To accumulate month I added units each day when I want to see is the last day of the month (final stock of the month)

I am using the formula

sum (if (Féchain <= date and fechaout> date, units, 0))

It works perfect for every day, not to level up and show month.

What formula should be used to build not to display the month and display only the value of the last day of the month?

Thank You

Translated with Google Translate - Qlik Community Administrative Team

Tengo un gráfico de stock en el que sumo unidades de stock en cada fecha.

El grupo jerárquico es día >> mes

Al acumular en mes me suma las unidades de cada día, cuando lo que deseo ver es el último día del mes (stock final del mes)

Estoy utilizando la formula

sum(if(fechain<=fecha and fechaout>fecha, unidades,0))

Funciona perfecto para cada día, no al subir de nivel y mostrar mes.

¿Qué fórmula debería utilizar para que no acumule al mostrar el mes y muestre sólo el valor del último día del mes?

Gracias

1 Solution

Accepted Solutions
ramoncova06
Partner - Specialist III
Partner - Specialist III

There are a couple of ways to do it personally, I think the easiest thing is to create a flag for each end of the month and then on the basis of that flag filtering result

The other option is using aggr and search in the set analysis to identify the last month results

I attached the option

Translated with Google Translate - Qlik Community Administrative Team

existen un par de maneras de hacerlo en lo personal, creo que lo más facil es crear una bandera para cada último día del mes y luego en base de esa bandera filtrar el resultado

la otra opción es usando aggr y search in el set analysis para identificar los ultimos resultados del mes

te adjunto la opcion

View solution in original post

6 Replies
ramoncova06
Partner - Specialist III
Partner - Specialist III

There are a couple of ways to do it personally, I think the easiest thing is to create a flag for each end of the month and then on the basis of that flag filtering result

The other option is using aggr and search in the set analysis to identify the last month results

I attached the option

Translated with Google Translate - Qlik Community Administrative Team

existen un par de maneras de hacerlo en lo personal, creo que lo más facil es crear una bandera para cada último día del mes y luego en base de esa bandera filtrar el resultado

la otra opción es usando aggr y search in el set analysis para identificar los ultimos resultados del mes

te adjunto la opcion

Not applicable
Author

Hola Ramón, gracias por la respuesta, creo que no adjuntaste el ejemplo.

Sds

ramoncova06
Partner - Specialist III
Partner - Specialist III

Hola Carolina, yo si veo el archivo adjunto, por si las dudas lo vuelvo a adjuntar

Not applicable
Author

Sí, disculpas, ahora lo veo. Pero tengo una personal edition y no me permite abrirlo.

Si puedes copiar la fórmula aquí sería de gran ayuda. Desde ya mil gracias!

Sds

ramoncova06
Partner - Specialist III
Partner - Specialist III

esto es con el cambio únicamente en el front end

if(GetCurrentField(Cal) = 'Fecha',

sum(Valor),

sum({<Fecha={$(=Concat(distinct chr(39)&Aggr(DATE(Max(Fecha),'M/dd/yyyy'),Mes)&chr(39),','))}>}Valor)

)

CAL es el nombre del grupo, en mi caso tuve que jugar con el formato de la fecha para que mi sistema lo reconociera como fecha



esto es con el cambio en el backend


Temp:

load

if(date(floor(MonthEnd(Fecha))) = Fecha, 1,0)  as UltimoDiaMes,

month(Fecha) as Mes,

*;

load * Inline

[Fecha Valor

1/1/2015 306

1/2/2015 384

1/3/2015 419

1/4/2015 311

1/5/2015 361

1/6/2015 338

1/7/2015 496

1/8/2015 366

1/9/2015 408

1/10/2015 445

1/11/2015 116

1/12/2015 148

1/13/2015 217

1/14/2015 362

1/15/2015 176

1/16/2015 401

1/17/2015 106

1/18/2015 358

1/19/2015 256

1/20/2015 467

1/21/2015 365

1/22/2015 248

1/23/2015 141

1/24/2015 381

1/25/2015 134

1/26/2015 362

1/27/2015 104

1/28/2015 399

1/29/2015 245

1/30/2015 438

1/31/2015 400

2/1/2015 291

2/2/2015 301

2/3/2015 182

2/4/2015 246

2/5/2015 182

2/6/2015 142

2/7/2015 295

2/8/2015 206

2/9/2015 273

2/10/2015 363

2/11/2015 459

2/12/2015 170

2/13/2015 124

2/14/2015 345

2/15/2015 301

2/16/2015 260

2/17/2015 212

2/18/2015 498

2/19/2015 398

2/20/2015 163

2/21/2015 234

2/22/2015 228

2/23/2015 291

2/24/2015 457

2/25/2015 442

2/26/2015 252

2/27/2015 479

2/28/2015 186

3/1/2015 281

3/2/2015 293

3/3/2015 366

3/4/2015 394

3/5/2015 486

3/6/2015 464

3/7/2015 119

3/8/2015 492

3/9/2015 491

3/10/2015 228

3/11/2015 416

3/12/2015 483

3/13/2015 276

3/14/2015 178

3/15/2015 289

3/16/2015 125

3/17/2015 380

3/18/2015 343

3/19/2015 312

3/20/2015 186

3/21/2015 282

3/22/2015 241

3/23/2015 473

3/24/2015 106

3/25/2015 151

3/26/2015 354

3/27/2015 312

3/28/2015 293

3/29/2015 252

3/30/2015 443

3/31/2015 206

4/1/2015 425

4/2/2015 158

4/3/2015 196

4/4/2015 237

4/5/2015 261

4/6/2015 497

4/7/2015 230

4/8/2015 435

4/9/2015 310

4/10/2015 443

4/11/2015 353

4/12/2015 283

4/13/2015 269

4/14/2015 156

4/15/2015 284

4/16/2015 452

4/17/2015 358

4/18/2015 172

4/19/2015 334

4/20/2015 414

4/21/2015 458

4/22/2015 407

4/23/2015 221

4/24/2015 125

4/25/2015 108

4/26/2015 128

4/27/2015 238

4/28/2015 232

4/29/2015 100

4/30/2015 475

5/1/2015 227

5/2/2015 313

5/3/2015 383

5/4/2015 268

5/5/2015 249

5/6/2015 174

5/7/2015 495

5/8/2015 295

5/9/2015 314

5/10/2015 135

5/11/2015 382

5/12/2015 456

5/13/2015 268

5/14/2015 191

5/15/2015 110

5/16/2015 240

5/17/2015 397

5/18/2015 132

5/19/2015 331

5/20/2015 425

5/21/2015 448

5/22/2015 388

5/23/2015 323

5/24/2015 370

5/25/2015 430

5/26/2015 354

5/27/2015 291

5/28/2015 368

5/29/2015 472

5/30/2015 173

5/31/2015 439

6/1/2015 322

6/2/2015 280

]

(delimiter is ' ');




//expression

if(GetCurrentField(Cal) = 'Fecha',

sum(Valor),

sum({<UltimoDiaMes = {1}>}Valor)

)

Not applicable
Author

Gracias, funcionó con Getcurrentfield.

Sds