Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trend expression in Straight Table

Hello,

I am working with a data table. I have started to use straight table and I would like to have a column as minichart.

I am looking at sa´lesamount/month and I would like to make the trend for 3 month.

For example :

SalesObject

SalesAmount

2017-01

SalesAmount

2017-02

SalesAmount

2017-03

MiniChart

(Trend) Or Rolling Average

A3570119?
B6045130
C104090
D189234
E241446
F2415512

I have tried the example in QV book but it didn't work. Is there anyone can help me?

/Shirin

8 Replies
Frank_Hartmann
Master II
Master II

Hi Shirin,

have a look at the attached qvw

hope this helps

Frank_Hartmann
Master II
Master II

Did this solve your problem?

If yes, then please close the thread by marking correct and helpful answers!

If not, please let us know the problems you are facing .....

Not applicable
Author

Hello Frank,

Yes. That helps but I put an example. If we don't want to have date like 2017-01 ... in the script , what should we do? Since the month will change. next month , 3 interested month are not the same ...

Frank_Hartmann
Master II
Master II

Im not sure if i understand your requirement correctly but you could write the script as below:

1:

CrossTable(Date, Data)

LOAD *

FROM

[https://community.qlik.com/thread/258555]

(html, codepage is 1252, embedded labels, table is @1, filters(

Remove(Col, Pos(Top, 5))

));

NoConcatenate

Load *,

    Subfield(Date,'-',2) as Month,

    '2017' as  Year

    Resident 1; DROP Table 1;

2:

LOAD *

FROM

[https://community.qlik.com/thread/258555]

(html, codepage is 1252, embedded labels, table is @1, filters(

Remove(Col, Pos(Top, 5))

));

hope this helps

Not applicable
Author

No. I don't think so. I mean I want to have date as variable not fixed dates.

Frank_Hartmann
Master II
Master II

So how do your dates look like next month and the month after next month?

Are there always only the last 3 month available, means in may showing 02, 03 and 04 and in june 03, 04 and 05?

or do you have more dates in your datasource, like 01,02,03,04,05....? If this is the case you might need to

use a mastercalender and filter to the last 3 month. have a look at the attached sample.

hope this helps!

Not applicable
Author

It's the first case you mentioned. This month 02,03,04 and next month 03,04 and 05.

Frank_Hartmann
Master II
Master II

Even in that case the above mentioned solution with mastercalendar should work!

Please have a deeper look into it.

hope this helps