Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Script logic

Hi all,

I got two months records as listed below

Table Jan:

cno   category     amount

1       gm1            234

2       gm2            535

3       gm3            789

4       gm4            456

Table  feb:

cno   category     amount

1       gm1            234

2       gm3            535

3       gm3            789

4       gm4            456

how can I show change in category like This Month Category  and Previous Month Category in a report. Change occurred in Record no 2

Thanks

JK

9 Replies
balkumarchandel
Valued Contributor II

Re: Script logic

Hi Janaki,

You can load your tables with diff column names then compare .

find attached qvw.

Let me know if this not your required result.

Re: Script logic

See attached qvw.


talk is cheap, supply exceeds demand
Not applicable

Re: Script logic

Hi Chandel,

In my data model monthly tables are concatenated, I can not change field name . Have you got any other logic to implement, answer will be much appreciated.

Thanks,

JK

balkumarchandel
Valued Contributor II

Re: Script logic

Please see this

Not applicable

Re: Script logic

Hi Gysbert,

Your logic is working but , i have to show data like

Current month category , Previous month Category

I am having difficulty here, can you help me on this.

neetha_p
Honored Contributor

Re: Script logic

Hi,

Create flags for category in load statements.

'JAN' as CategoryMonth

'FEB' as CategoryMonth

use this flags in expressions

Re: Script logic

is cno an unique ID/key field?

MVP
MVP

Re: Script logic

Hi,

Try like this

Data:

LOAD

*,

1 AS Month

FROM JanData;

Concatenate(Data)

LOAD

*,

2 AS Month

FROM FebData;

Now you can use expresions

For Current Month

=Sum({<Month={$(=Max(Month))}>} amount)

For Previous Month

=Sum({<Month={$(=Max(Month) -1)}>} amount)

Hope this helps you.

Regards,

Jagan.

Not applicable

Re: Script logic

No there are some duplicate numbers on that field.

Community Browser