Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Specialist II
Specialist II

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.

Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand
Not applicable

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
Specialist II
Specialist II

Please see this

Not applicable

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
Master
Master

Hi,

Create flags for category in load statements.

'JAN' as CategoryMonth

'FEB' as CategoryMonth

use this flags in expressions

MarcoWedel

is cno an unique ID/key field?

jagan
MVP & Luminary
MVP & Luminary

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

No there are some duplicate numbers on that field.