Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cash flow Sense

Hi everyone,

I'd like to know whether it was possible or not to do draw something similar to the straight table you find attached here in Qlik Sense.

I found it quite difficult since rows are measure and not dimension, and "Apertura" has to carry the same value as "Chiusura" in the previous period.

Thanks in advance for your help,

regards

gf

3 Replies
matteo901p
Partner - Contributor III
Partner - Contributor III

Ciao Gabriele ,

Can u post an example of your source input file?
I not understand if your picture is the final result if you would..

Ciao Gabriele,

Puoi postare un esempio di excel che hai di input?
Non ho ben chiaro se l'immagine che hai allegato è il risultato che vuoi, oppure è il foglio excel di partenza da replicare in QS, con i dovuti calcoli...

matteo901p
Partner - Contributor III
Partner - Contributor III

Before your response, i'm trying to replicate your situation..

There is a simple script that u can try with your data or simple excel that i create like your picture..

//MAPPATURA PER DESCRIZIONE CAMPO//

//

//MI CALCOLO IL NUMERO DI COLONNE PRESENTI. NB Solo il numero delle colonne(intestazioni) orizzontali ANNOMESE//

NUM_COL:

LOAD [201501.000000],

    [201502.000000],

    [201503.000000],

    [201504.000000],

    [201505.000000]

FROM

[Rettifiche.xlsx]

(ooxml, embedded labels, table is Sheet1, filters(

Remove(Row, Pos(Top, 2)),

Remove(Row, Pos(Top, 2)),

Remove(Row, Pos(Top, 2)),

Remove(Row, Pos(Top, 2))

));

//Mi estraggo il numero

LET vFieldNo = NoOfFields('NUM_COL');  //---- VISTA LA FOTO, SONO 5: 201501 .. 201505 => 5 campi trovati!

DROP TABLE NUM_COL;

//Ciclo per il valore precedentemente calcolato

FOR I=1 TO $(vFieldNo)  //ciclo da 1 a 5 per crearmi le dimensioni

TABELLA_INPUT:

LOAD

'20150$(I)' AS ANNOMESE,

[20150$(I)] AS VALORI,

IF(recno()=1,'Clienti',

IF(RECNO()=2,'Altre Entrate',

if(recno()=3,'Fornitori',

if(recno()=4,'Altre Uscite'))))              as DESCRIZIONE_VALORE,

'$(I)' as CONTATORE,                        //Nel caso tu voglia testarla

Recno() as BLOCCO_RIGA,              //Nel caso tu voglia testarla

rowno() as NUMERO_RIGA              //Nel caso tu voglia testarla

FROM

[Rettifiche.xlsx]

(ooxml, embedded labels, table is Sheet1);

//FOR TESTING

LET vIndicePrecedente=if((I-1)=0,1,(I-1)); //NON avendo l'anno precedente, considero l'apertura 201501 proprio la somma della prima colonna 201501 e non 201412 .. si può cambiatre facilmente

TABELLA_INPUT2:

Concatenate

LOAD distinct

'20150$(I)' AS ANNOMESE,

sum([20150$(vIndicePrecedente)]) aS VALORI, //Sommo la colonna precedente

'APERTURA' as DESCRIZIONE_VALORE

//Recno() as BLOCCO_RIGA

from

[Rettifiche.xlsx]

(ooxml, embedded labels, table is Sheet1)

GROUP BY 1;

NEXT //Passo al prossimo indice

With this, the result is like below picture:risultato.PNG

matteo901p
Partner - Contributor III
Partner - Contributor III

..And this is .qvf for testing