Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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
Anonymous
Not applicable
Author

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
Author

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

Anonymous
Not applicable
Author

Please see this

Not applicable
Author

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.

Anonymous
Not applicable
Author

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
Luminary Alumni
Luminary Alumni

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
Author

No there are some duplicate numbers on that field.