Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

data show curret vs prev

Hi Folks

i have data like this

load * Inline [

cn,month,score

a,201607,1

b,201607,2

c,201607,3

d,201607,4

a,201608,11

b,201608,12

c,201608,13

d,201608,14

a,201609,12

b,201609,14

c,201609,13

d,201609,18

]

here i want get the  Cn(custmrname)  where there is change between currentmonth(201609) and previous month(201608)

ex:

cn -a value for  201609  is 11

cn-a value for 201608 is  12

i need to show the current year and previous score for the custmers only where score cchanged between current month and previous month

if u see in this case   cn-c is not going to come as a output record

i want do this calculation in ui level only 

could u pls help on this 

1 Solution

Accepted Solutions
sunny_talwar

Check this out

Capture.PNG

Dimension

cn

Expressions

If(Sum({<month = {"$(=Max(month, 2))"}>} score) - Sum({<month = {"$(=Max(month))"}>} score) <> 0, Sum({<month = {"$(=Max(month, 2))"}>} score))

If(Sum({<month = {"$(=Max(month, 2))"}>} score) - Sum({<month = {"$(=Max(month))"}>} score) <> 0, Sum({<month = {"$(=Max(month))"}>} score))

View solution in original post

9 Replies
sunny_talwar

Where do you wish to see this output? In a straight table or text box? Also, are these results based on selection of a specific date or is this needed for all periods?

Anonymous
Not applicable
Author

i want see it in stright table

i want compare this result every time for current month vs  previous month

sunny_talwar

Check this out

Capture.PNG

Dimension

cn

Expressions

If(Sum({<month = {"$(=Max(month, 2))"}>} score) - Sum({<month = {"$(=Max(month))"}>} score) <> 0, Sum({<month = {"$(=Max(month, 2))"}>} score))

If(Sum({<month = {"$(=Max(month, 2))"}>} score) - Sum({<month = {"$(=Max(month))"}>} score) <> 0, Sum({<month = {"$(=Max(month))"}>} score))

Anonymous
Not applicable
Author

it looks super,

could u please send me the qvw file , i will access from my end ,i have licensed version

sunny_talwar

It is attached to me response above. Open this link to see it attached

Re: data show curret vs prev

Anonymous
Not applicable
Author

Hi,

originally i have data like this

Table:

LOAD cn,

  Date(Date#(month, 'YYYYMM'), 'YYYYMM') as month,

  score;

LOAD * Inline [

cn,month,score

a,201607,1

b,201607,2

c,201607,3

d,201607,4

a,201608,11-

b,201608,12

c,201608,13

d,201608,14

a,201609,12

b,201609,14+

c,201609,13

d,201609,18

];

including + and - symbols

is there any way to logic for this when we have like this

sunny_talwar

What does the symbol means? 11- means -11? I mean how would you compare 11- with the previous period?

Anonymous
Not applicable
Author

Yes we cant , but they are displaying like that

11, 11-

10, 10+

......

but some other team did this requirement some how .

sunny_talwar

May be like this?

Capture.PNG